1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 06:14:32 +00:00

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.
This commit is contained in:
wm4 2018-01-09 09:18:18 +01:00 committed by Martin Herkt
parent 6e974f77bd
commit 0a406f97e0
2 changed files with 4 additions and 0 deletions

View File

@ -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
}
}

View File

@ -504,6 +504,8 @@ void video_work(struct dec_video *d_video)
read_frame(d_video);
if (!d_video->current_mpi) {
feed_packet(d_video);
if (d_video->current_state == DATA_WAIT)
return;
read_frame(d_video); // retry, to avoid redundant iterations
}
}