Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EAX] Fix error handling #953

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions al/eax/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ constexpr auto EAXCONTEXT_MINMACROFXFACTOR = 0.0F;
constexpr auto EAXCONTEXT_MAXMACROFXFACTOR = 1.0F;
constexpr auto EAXCONTEXT_DEFAULTMACROFXFACTOR = 0.0F;

constexpr auto EAXCONTEXT_DEFAULTLASTERROR = EAX_OK;

extern const GUID EAXPROPERTYID_EAX40_FXSlot0;
extern const GUID EAXPROPERTYID_EAX50_FXSlot0;
Expand Down
5 changes: 4 additions & 1 deletion alc/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void ALCcontext::eax_update_speaker_configuration()

void ALCcontext::eax_set_last_error_defaults() noexcept
{
mEaxLastError = EAX_OK;
mEaxLastError = EAXCONTEXT_DEFAULTLASTERROR;
}

void ALCcontext::eax_session_set_defaults() noexcept
Expand Down Expand Up @@ -675,6 +675,7 @@ void ALCcontext::eax_get_misc(const EaxCall& call)
break;
case EAXCONTEXT_LASTERROR:
call.set_value<ContextException>(mEaxLastError);
mEaxLastError = EAX_OK;
break;
case EAXCONTEXT_SPEAKERCONFIG:
call.set_value<ContextException>(mEaxSpeakerConfig);
Expand Down Expand Up @@ -1045,6 +1046,7 @@ try
}
catch(...)
{
context->eaxSetLastError();
eax_log_exception(__func__);
return AL_INVALID_OPERATION;
}
Expand Down Expand Up @@ -1072,6 +1074,7 @@ try
}
catch(...)
{
context->eaxSetLastError();
eax_log_exception(__func__);
return AL_INVALID_OPERATION;
}
Expand Down