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.
This commit is contained in:
Max Kellermann
2013-11-06 23:10:05 +01:00
parent 9802e74859
commit 0be5a6ab2b
3 changed files with 26 additions and 4 deletions

View File

@@ -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();
}