1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

player: fix missed wakeup on video EOF

If video EOF happens during playback restart, and audio is syncing, and
the demuxer packet queue overflows (i.e. no new packets will be read),
then it could happen that the player accidentally enters sleeping, and
continues playing anything only after e.g. user input wakes it up.
This commit is contained in:
wm4 2015-10-09 15:53:02 +02:00
parent a62dcdd5f4
commit dbbde6161d

View File

@ -1101,11 +1101,14 @@ void write_video(struct MPContext *mpctx, double endpts)
return;
if (r == VD_EOF) {
int prev_state = mpctx->video_status;
mpctx->video_status =
vo_still_displaying(vo) ? STATUS_DRAINING : STATUS_EOF;
mpctx->delay = 0;
mpctx->last_av_difference = 0;
MP_DBG(mpctx, "video EOF (status=%d)\n", mpctx->video_status);
if (prev_state != mpctx->video_status)
mpctx->sleeptime = 0;
return;
}