1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 00:02:13 +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; return;
if (r == VD_EOF) { if (r == VD_EOF) {
int prev_state = mpctx->video_status;
mpctx->video_status = mpctx->video_status =
vo_still_displaying(vo) ? STATUS_DRAINING : STATUS_EOF; vo_still_displaying(vo) ? STATUS_DRAINING : STATUS_EOF;
mpctx->delay = 0; mpctx->delay = 0;
mpctx->last_av_difference = 0; mpctx->last_av_difference = 0;
MP_DBG(mpctx, "video EOF (status=%d)\n", mpctx->video_status); MP_DBG(mpctx, "video EOF (status=%d)\n", mpctx->video_status);
if (prev_state != mpctx->video_status)
mpctx->sleeptime = 0;
return; return;
} }