From 401411911c9589f9ec60eee714c11174b1c600a1 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 6 May 2018 19:55:20 +1000 Subject: [PATCH] WASAPI: Fix a bug with stopping and restarting devices. --- mini_al.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mini_al.h b/mini_al.h index a9935d29..a483369a 100644 --- a/mini_al.h +++ b/mini_al.h @@ -5868,6 +5868,12 @@ mal_result mal_device__stop_backend__wasapi(mal_device* pDevice) return mal_post_error(pDevice, "[WASAPI] Failed to stop internal device.", MAL_FAILED_TO_STOP_BACKEND_DEVICE); } + // The client needs to be reset or else we won't be able to resume it again. + hr = mal_IAudioClient_Reset((mal_IAudioClient*)pDevice->wasapi.pAudioClient); + if (FAILED(hr)) { + return mal_post_error(pDevice, "[WASAPI] Failed to reset internal device.", MAL_FAILED_TO_STOP_BACKEND_DEVICE); + } + return MAL_SUCCESS; }