diff --git a/NEWS b/NEWS index daa2b77a7..cdc114954 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ ver 0.23.6 (not yet released) - opus: fix "readpicture" on Opus files * output - pipewire: fix crash bug if setting volume before playback starts + - wasapi: fix resume after pause ver 0.23.5 (2021/12/01) * protocol diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx index bedd9f756..992dc2e67 100644 --- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx +++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx @@ -471,6 +471,16 @@ try { } UINT32 write_in_frames = buffer_size_in_frames; + DWORD mode = 0; + AtScopeExit(&) { + render_client->ReleaseBuffer(write_in_frames, mode); + + if (!started) { + Start(client); + started = true; + } + }; + if (!is_exclusive) { UINT32 data_in_frames = GetCurrentPaddingFrames(client); @@ -481,7 +491,6 @@ try { } BYTE *data; - DWORD mode = 0; if (HRESULT result = render_client->GetBuffer(write_in_frames, &data); @@ -489,15 +498,6 @@ try { throw MakeHResultError(result, "Failed to get buffer"); } - AtScopeExit(&) { - render_client->ReleaseBuffer(write_in_frames, mode); - - if (!started) { - Start(client); - started = true; - } - }; - const UINT32 write_size = write_in_frames * frame_size; UINT32 new_data_size = 0; new_data_size = spsc_buffer.pop(data, write_size);