aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alc.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-12-17 21:07:53 -0800
committerChris Robinson <[email protected]>2020-12-17 21:07:53 -0800
commit5edd5a11fc16147ee25566db75732533005d1f46 (patch)
tree7f6e89f7c7afcb150a57b40f8aa5c25baf26c43e /alc/alc.cpp
parent7d2e21334c5bc6423abed3b450d369829d7c1fde (diff)
Don't use ALC error enums for the backend error code
Diffstat (limited to 'alc/alc.cpp')
-rw-r--r--alc/alc.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index f8bef7de..1a45cbe3 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -1944,7 +1944,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
try {
auto backend = device->Backend.get();
if(!backend->reset())
- throw al::backend_exception{ALC_INVALID_DEVICE, "Device reset failure"};
+ throw al::backend_exception{al::backend_error::DeviceError, "Device reset failure"};
}
catch(std::exception &e) {
device->handleDisconnect("%s", e.what());
@@ -3518,7 +3518,8 @@ START_API_FUNC
}
catch(al::backend_exception &e) {
WARN("Failed to open playback device: %s\n", e.what());
- alcSetError(nullptr, e.errorCode());
+ alcSetError(nullptr, (e.errorCode() == al::backend_error::OutOfMemory)
+ ? ALC_OUT_OF_MEMORY : ALC_INVALID_VALUE);
return nullptr;
}
@@ -3771,7 +3772,8 @@ START_API_FUNC
}
catch(al::backend_exception &e) {
WARN("Failed to open capture device: %s\n", e.what());
- alcSetError(nullptr, e.errorCode());
+ alcSetError(nullptr, (e.errorCode() == al::backend_error::OutOfMemory)
+ ? ALC_OUT_OF_MEMORY : ALC_INVALID_VALUE);
return nullptr;
}
@@ -3944,7 +3946,8 @@ START_API_FUNC
}
catch(al::backend_exception &e) {
WARN("Failed to open loopback device: %s\n", e.what());
- alcSetError(nullptr, e.errorCode());
+ alcSetError(nullptr, (e.errorCode() == al::backend_error::OutOfMemory)
+ ? ALC_OUT_OF_MEMORY : ALC_INVALID_VALUE);
return nullptr;
}