diff options
author | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-12-15 20:00:21 +0000 |
---|---|---|
committer | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-12-15 20:00:21 +0000 |
commit | 45f0c5213d76a9272900b1f045cbb58863fa6dff (patch) | |
tree | c668535a92133451367e092f50d74bec1a09df0e | |
parent | 89750dcaa257fae98fc0861a53d3f21a9b3d5afc (diff) | |
download | nohands-45f0c5213d76a9272900b1f045cbb58863fa6dff.tar.gz |
Avoid waking the output thread if the output queue is empty.
git-svn-id: http://nohands.svn.sourceforge.net/svnroot/nohands/trunk@68 126591fb-c623-4b62-a76d-97a8e4f34109
-rw-r--r-- | libhfp/soundio-alsa.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libhfp/soundio-alsa.cpp b/libhfp/soundio-alsa.cpp index 6c14c6a..9565684 100644 --- a/libhfp/soundio-alsa.cpp +++ b/libhfp/soundio-alsa.cpp @@ -1370,9 +1370,12 @@ public: } virtual void SndPushOutput(bool nonblock) { - /* Wake up the output thread if it's sleeping */ + /* + * Wake up the output thread if it's sleeping and + * there's something for it to do + */ m_lock.Lock(); - if (m_play_idle) + if (m_play_idle && m_output.TotalFill()) m_lock.Signal(); m_lock.Unlock(); } |