summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-03-08 23:02:43 +0100
committerMax Kellermann <max@musicpd.org>2021-03-08 23:03:25 +0100
commit0a97e68aa9dfaea4dab9961479134d23c6007276 (patch)
tree5e1d5629d89cd388b44ad373853ee8911de8e97a /src/output
parent69783a44c8b926ea5858852fa7a35cc9ed22c539 (diff)
output/wasapi: start after the buffer has been filled
Postpone the Start() call until there is something to be played.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/wasapi/WasapiOutputPlugin.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
index a9787cf4d..eed47591b 100644
--- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
@@ -355,16 +355,10 @@ try {
return;
}
- if (!started) {
- if (current_state != Status::PLAY)
- /* don't bother starting the
- IAudioClient if we're
- paused */
- continue;
-
- Start(client);
- started = true;
- }
+ if (!started && current_state != Status::PLAY)
+ /* don't bother starting the IAudioClient if
+ we're paused */
+ continue;
UINT32 write_in_frames = buffer_size_in_frames;
if (!is_exclusive) {
@@ -387,6 +381,11 @@ try {
AtScopeExit(&) {
render_client->ReleaseBuffer(write_in_frames, mode);
+
+ if (!started) {
+ Start(client);
+ started = true;
+ }
};
if (current_state == Status::PLAY) {