aboutsummaryrefslogtreecommitdiffstats
path: root/src/DecoderInternal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-11-06 23:10:05 +0100
committerMax Kellermann <max@duempel.org>2013-11-06 23:51:17 +0100
commit0be5a6ab2b9201e60f3ecb363fcc9342ecfa8aee (patch)
tree0e1a98376069ab299dbd701d7be40f8030da70f8 /src/DecoderInternal.cxx
parent9802e74859219ae151cddb238f71016e3a2ef1ef (diff)
downloadmpd-0be5a6ab2b9201e60f3ecb363fcc9342ecfa8aee.tar.gz
mpd-0be5a6ab2b9201e60f3ecb363fcc9342ecfa8aee.tar.xz
mpd-0be5a6ab2b9201e60f3ecb363fcc9342ecfa8aee.zip
DecoderControl: reduce the number of PlayerThread wakeups
Wake up the PlayerThread only if it is really waiting for the decoder. This greatly reduces the number of system calls in the DecoderThread.
Diffstat (limited to 'src/DecoderInternal.cxx')
-rw-r--r--src/DecoderInternal.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/DecoderInternal.cxx b/src/DecoderInternal.cxx
index 7cca5dbe3..e18fd2b6a 100644
--- a/src/DecoderInternal.cxx
+++ b/src/DecoderInternal.cxx
@@ -102,6 +102,7 @@ decoder_flush_chunk(Decoder &decoder)
decoder.chunk = nullptr;
dc.Lock();
- dc.client_cond.signal();
+ if (dc.client_is_waiting)
+ dc.client_cond.signal();
dc.Unlock();
}