diff options
author | Chris Robinson <[email protected]> | 2023-12-13 10:15:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-13 10:15:10 -0800 |
commit | 70b3776032adf05a92fda89ac5f56eb705d06748 (patch) | |
tree | 319d3c26d5c0add87c2a8ad0c811a83171cdafbd /alc | |
parent | b81a270f6c1e795ca70d7684e0ccf35a19f247e2 (diff) |
Don't fail alcDevicePauseSOFT for disconnected devices
The device playback is stopped so the function doesn't technically fail. This
primarily just allows the device state to be flagged as paused for a subsequent
reset or reopen, which covers a potential issue where a device is disconnected,
the app pauses it due to something like an incoming call or being put into the
background, then successfully resets or reopens the device before playback
should resume. Without this, the device will (try to) start immediately upon
being reset or reopened, which would either fail (and disconnect again) or
start playing again prematurely before it can be stopped.
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index 784c9661..93e28845 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -3312,12 +3312,6 @@ ALC_API void ALC_APIENTRY alcDevicePauseSOFT(ALCdevice *device) noexcept else { std::lock_guard<std::mutex> _{dev->StateLock}; - if(!dev->Connected.load()) - { - WARN("Cannot pause a disconnected device\n"); - alcSetError(dev.get(), ALC_INVALID_DEVICE); - return; - } if(dev->mDeviceState == DeviceState::Playing) { dev->Backend->stop(); |