From f8f95e2dbd73d0d43211136e50a8d640f145872c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Nov 2013 23:47:30 +0100 Subject: 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. --- src/OutputControl.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/OutputControl.cxx') 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) -- cgit v1.2.3