From 0be5a6ab2b9201e60f3ecb363fcc9342ecfa8aee Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Nov 2013 23:10:05 +0100 Subject: 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. --- src/DecoderInternal.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/DecoderInternal.cxx') 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(); } -- cgit v1.2.3