From dbbde6161d939a1e97e67a5d4c802eff315efed9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 9 Oct 2015 15:53:02 +0200 Subject: 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. --- player/video.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player') diff --git a/player/video.c b/player/video.c index 873ff632a5..7bccdefb34 100644 --- a/player/video.c +++ b/player/video.c @@ -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; } -- cgit v1.2.3