diff options
author | Boris I. Bendovsky <[email protected]> | 2023-12-21 21:44:29 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-21 19:44:29 +0000 |
commit | 32dbdd9d0443e9fdd150a2ccc6c0682f5fd8206e (patch) | |
tree | a464891f24b3aef06d0b90d35bb335086fb4c44c /alc | |
parent | 9ccddf8fc6ca11dbb50af0f063b05e0d419616c0 (diff) |
[EAX] Fix error handling (#953)
- Set error on EAX call failure if context is available.
- Reset error on successful retreiving the last error code.
Reference: EAX 4.0 - Programmer's Guide (pg.37)
Diffstat (limited to 'alc')
-rw-r--r-- | alc/context.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alc/context.cpp b/alc/context.cpp index ff22acdf..b5db03f9 100644 --- a/alc/context.cpp +++ b/alc/context.cpp @@ -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 @@ -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); @@ -1045,6 +1046,7 @@ try } catch(...) { + context->eaxSetLastError(); eax_log_exception(__func__); return AL_INVALID_OPERATION; } @@ -1072,6 +1074,7 @@ try } catch(...) { + context->eaxSetLastError(); eax_log_exception(__func__); return AL_INVALID_OPERATION; } |