diff options
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 39d5c37543..1946fd6e60 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -3183,6 +3183,7 @@ static void run_playloop(struct MPContext *mpctx) vo_new_frame_imminent(vo); struct sh_video *sh_video = mpctx->sh_video; mpctx->video_pts = sh_video->pts; + mpctx->last_vo_pts = mpctx->video_pts; update_subtitles(mpctx, sh_video->pts); update_osd_msg(mpctx); draw_osd(mpctx); @@ -3369,6 +3370,18 @@ static void run_playloop(struct MPContext *mpctx) queue_seek(mpctx, MPSEEK_RELATIVE, step_sec, 0); } + if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE) { + mpctx->stop_play = KEEP_PLAYING; + pause_player(mpctx); + if (mpctx->video_out && !mpctx->video_out->hasframe) { + // Force screen refresh to make OSD usable + double seek_to = mpctx->last_vo_pts; + if (seek_to == MP_NOPTS_VALUE) + seek_to = 0; // arbitrary default + queue_seek(mpctx, MPSEEK_ABSOLUTE, seek_to, 1); + } + } + /* Looping. */ if (opts->loop_times >= 0 && (mpctx->stop_play == AT_END_OF_FILE || mpctx->stop_play == PT_NEXT_ENTRY)) { @@ -4019,6 +4032,7 @@ goto_enable_cache: mpctx->drop_message_shown = 0; mpctx->restart_playback = true; mpctx->video_pts = 0; + mpctx->last_vo_pts = MP_NOPTS_VALUE; mpctx->last_seek_pts = 0; mpctx->hrseek_active = false; mpctx->hrseek_framedrop = false; |