diff options
author | Max Kellermann <max@duempel.org> | 2013-11-06 23:47:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-11-06 23:51:17 +0100 |
commit | f8f95e2dbd73d0d43211136e50a8d640f145872c (patch) | |
tree | 9d4ea69a9c668f6286e0dc6de38ec5dfb650a55e /src/OutputControl.cxx | |
parent | 77c63511d8809f7785328138e7e3a50303302730 (diff) | |
download | mpd-f8f95e2dbd73d0d43211136e50a8d640f145872c.tar.gz mpd-f8f95e2dbd73d0d43211136e50a8d640f145872c.tar.xz mpd-f8f95e2dbd73d0d43211136e50a8d640f145872c.zip |
OutputControl: reduce the number of OutputThread wakeups
Wake up the OutputThread only if it hasn't already been woken up and
if it isn't already in the playback loop.
Diffstat (limited to '')
-rw-r--r-- | src/OutputControl.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx index 648705908..553507a2a 100644 --- a/src/OutputControl.cxx +++ b/src/OutputControl.cxx @@ -248,8 +248,11 @@ audio_output_play(struct audio_output *ao) assert(ao->allow_play); - if (audio_output_is_open(ao)) + if (audio_output_is_open(ao) && !ao->in_playback_loop && + !ao->woken_for_play) { + ao->woken_for_play = true; ao->cond.signal(); + } } void audio_output_pause(struct audio_output *ao) |