aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-10-09 15:53:02 +0200
committerGravatar wm4 <wm4@nowhere>2015-10-09 15:53:02 +0200
commitdbbde6161d939a1e97e67a5d4c802eff315efed9 (patch)
treeff34307d0c0eac1ec593d71ae21ef928533da8b4
parenta62dcdd5f4d265d6160863486266c845ac295af1 (diff)
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.
-rw-r--r--player/video.c3
1 files changed, 3 insertions, 0 deletions
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;
}