summaryrefslogtreecommitdiffstats
path: root/audio/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-09 09:18:18 +0100
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2018-01-09 09:19:56 +0100
commit0a406f97e09ae81ac376fb8438f92bf50785c4cf (patch)
treeab8cf5539957e5c594d546ea4585cb18d3508910 /audio/decode
parent6e974f77bdb9f194d4c2c0c1dc36703419dbd0df (diff)
downloadmpv-0a406f97e09ae81ac376fb8438f92bf50785c4cf.tar.bz2
mpv-0a406f97e09ae81ac376fb8438f92bf50785c4cf.tar.xz
video, audio: don't actively wait for demuxer input
If feed_packet() ended with DATA_WAIT, the player should have gone to sleep, until the demuxer wakes it up again when there is new data. But the call to read_frame() unconditionally overwrote this status code, so it never waited. The consequence was that the core burned CPU by effectively polling the demuxer status, which was noticeable especially when seeking in network streams (since seeking is async, decoders will start out with having to wait for network). Regression since commit 33e5755c.
Diffstat (limited to 'audio/decode')
-rw-r--r--audio/decode/dec_audio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c
index cd83cfd55e..111f981690 100644
--- a/audio/decode/dec_audio.c
+++ b/audio/decode/dec_audio.c
@@ -284,6 +284,8 @@ void audio_work(struct dec_audio *da)
read_frame(da);
if (!da->current_frame) {
feed_packet(da);
+ if (da->current_state == DATA_WAIT)
+ return;
read_frame(da); // retry, to avoid redundant iterations
}
}