mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user