path: root/mpvcore/mplayer.c
diff options
authorwm4 <wm4@nowhere>2013-10-01 23:48:51 +0200
committerwm4 <wm4@nowhere>2013-10-02 00:42:18 +0200
commit3c0333978ecba247109366bf07fdfe87dd4a6b38 (patch)
tree3e218b5693e480cecf5fa752ee24dbf0bd175504 /mpvcore/mplayer.c
parent7be13b4690fa179cc83b0dcfd0f3bd2f8b680847 (diff)
core: don't require "refresh" seek for --keep-open
Seeking normally resets the VO and throws away the currently displayed frame, so if you seek outside the video with --keep-open enabled, the window would normally be "stuck" and not redraw properly, because there is no source video frame that could be redrawn. To deal with this, a precise seek to the position of the last displayed video frame was issued. This usually worked, but it can fail for formats where seeking is broken or not possible (consider reading from a pipe). Fix this by changing the semantics for vo_seek_reset(): now the video frame is remembered even after seeking. Note that this changes behavior a little when trying to seek outside of a file with --keep-open enabled. Since no actual seek is done anymore, the video will remain "frozen" on the previous position, and you can't unpause or framestep to see the video between current position and actual end of the video. If users complain, I might revert this commit.
Diffstat (limited to 'mpvcore/mplayer.c')
1 files changed, 1 insertions, 7 deletions
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index 87e8601153..280cc87f3e 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -3523,14 +3523,8 @@ static void handle_keep_open(struct MPContext *mpctx)
struct MPOpts *opts = mpctx->opts;
if (opts->keep_open && mpctx->stop_play == AT_END_OF_FILE) {
mpctx->stop_play = KEEP_PLAYING;
+ mpctx->playback_pts = mpctx->last_vo_pts;
- 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);
- }