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.
This commit is contained in:
wm4 2013-10-01 23:48:51 +02:00
parent 7be13b4690
commit 3c0333978e
1 changed files with 1 additions and 7 deletions

View File

@ -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;
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);
}
}
}