summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_pcm.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-11 19:00:05 +0200
committerwm4 <wm4@nowhere>2014-05-11 19:00:05 +0200
commit665c8b59be236a1dbe3dff12afc36946ca825830 (patch)
tree8cb8970b788425595d733e9b2d6c3f10f2bed459 /audio/out/ao_pcm.c
parentfd56e2dbe6aefb637af222e111d052c507883c7d (diff)
downloadmpv-665c8b59be236a1dbe3dff12afc36946ca825830.tar.bz2
mpv-665c8b59be236a1dbe3dff12afc36946ca825830.tar.xz
audio/out: avoid wakeup feedback loop
When the audio buffer went low, but could not be refilled yet, it could happen that the AO playback thread and the decode thread could enter a wakeup feedback loop, causing up to 100% CPU usage doing nothing. This happened because the decoder thread would wake up the AO thread when writing 0 bytes of newly decoded data, and the AO thread in reaction wakes up the decoder thread after writing 0 bytes to the AO buffer. Fix this by waking up the decoder thread only if data was actually played or queued. (This will still cause some redundant wakeups, but will eventually settle down, reducing CPU usage close to ideal.)
Diffstat (limited to 'audio/out/ao_pcm.c')
0 files changed, 0 insertions, 0 deletions