diff options
author | Chris Robinson <[email protected]> | 2019-10-07 21:37:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-07 21:37:56 -0700 |
commit | 02d80cd74dd7b4517550af2f4ea22c409323a1d9 (patch) | |
tree | f72a927a6565d76dc7087f1a15f82733d92b4155 /alc/backends/null.cpp | |
parent | f8ff4e269bf04aae1c430dbb218b4f4f6605df45 (diff) |
Use exceptions for backend open failures
Diffstat (limited to 'alc/backends/null.cpp')
-rw-r--r-- | alc/backends/null.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/alc/backends/null.cpp b/alc/backends/null.cpp index b6b115f1..aca59605 100644 --- a/alc/backends/null.cpp +++ b/alc/backends/null.cpp @@ -31,6 +31,7 @@ #include <thread> #include "alcmain.h" +#include "alexcpt.h" #include "almalloc.h" #include "alu.h" #include "logging.h" @@ -51,7 +52,7 @@ struct NullBackend final : public BackendBase { int mixerProc(); - ALCenum open(const ALCchar *name) override; + void open(const ALCchar *name) override; bool reset() override; bool start() override; void stop() override; @@ -108,16 +109,14 @@ int NullBackend::mixerProc() } -ALCenum NullBackend::open(const ALCchar *name) +void NullBackend::open(const ALCchar *name) { if(!name) name = nullDevice; else if(strcmp(name, nullDevice) != 0) - return ALC_INVALID_VALUE; + throw al::backend_exception{ALC_INVALID_VALUE, "Device name \"%s\" not found", name}; mDevice->DeviceName = name; - - return ALC_NO_ERROR; } bool NullBackend::reset() |