From 36779c368bb8ea1de985c6f4cf66f125950aedc0 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 17 Jul 2021 12:19:40 +1000 Subject: [PATCH] PulseAudio: Enable the stop callback when a stream is suspended. Public issue https://github.com/mackron/miniaudio/issues/341 --- miniaudio.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/miniaudio.h b/miniaudio.h index ed174cf0..475b7330 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -23159,14 +23159,9 @@ static void ma_device_on_suspended__pulse(ma_pa_stream* pStream, void* pUserData if (suspended == 1) { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[Pulse] Device suspended state changed. Suspended.\n"); - /* Locking this behind MA_DEBUG_OUTPUT for the moment while this is still in an experimental state. */ - #if defined(MA_DEBUG_OUTPUT) - { - if (pDevice->onStop) { - pDevice->onStop(pDevice); - } + if (pDevice->onStop) { + pDevice->onStop(pDevice); } - #endif } else { ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_DEBUG, "[Pulse] Device suspended state changed. Resumed.\n"); } @@ -69395,7 +69390,8 @@ The following miscellaneous changes have also been made. REVISION HISTORY ================ v0.10.39 - TBD - - Fix compilation errors on macOS and iOS. + - Core Audio: Fix compilation errors on macOS and iOS. + - PulseAudio: Fix a bug where the stop callback is not fired when a device is unplugged. v0.10.38 - 2021-07-14 - Fix a linking error when MA_DEBUG_OUTPUT is not enabled.