From 36f2a1c31261a1f97162b90d8f1e80c68d059183 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 25 Sep 2024 04:23:49 -0700 Subject: [PATCH] Return ALC_FALSE on error from alcEventIsSupportedSOFT This helps distinguish invalid inputs that set an ALC error on the null device, from normal "not supported" responses. --- alc/alc.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/alc/alc.cpp b/alc/alc.cpp index 1394a7bd..95e8b9e9 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -3618,25 +3618,25 @@ FORCE_ALIGN ALCenum ALC_APIENTRY alcEventIsSupportedSOFT(ALCenum eventType, ALCe { WARN("Invalid event type: 0x%04x\n", eventType); alcSetError(nullptr, ALC_INVALID_ENUM); - return ALC_EVENT_NOT_SUPPORTED_SOFT; + return ALC_FALSE; } auto supported = alc::EventSupport::NoSupport; switch(deviceType) { - case ALC_PLAYBACK_DEVICE_SOFT: - if(PlaybackFactory) - supported = PlaybackFactory->queryEventSupport(*etype, BackendType::Playback); - break; + case ALC_PLAYBACK_DEVICE_SOFT: + if(PlaybackFactory) + supported = PlaybackFactory->queryEventSupport(*etype, BackendType::Playback); + return al::to_underlying(supported); - case ALC_CAPTURE_DEVICE_SOFT: - if(CaptureFactory) - supported = CaptureFactory->queryEventSupport(*etype, BackendType::Capture); - break; + case ALC_CAPTURE_DEVICE_SOFT: + if(CaptureFactory) + supported = CaptureFactory->queryEventSupport(*etype, BackendType::Capture); + return al::to_underlying(supported); - default: - WARN("Invalid device type: 0x%04x\n", deviceType); - alcSetError(nullptr, ALC_INVALID_ENUM); + default: + WARN("Invalid device type: 0x%04x\n", deviceType); + alcSetError(nullptr, ALC_INVALID_ENUM); } - return al::to_underlying(supported); + return ALC_FALSE; } -- 2.11.4.GIT