summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-04 02:59:42 +0200
committerwm4 <wm4@nowhere>2013-05-05 18:44:24 +0200
commite4837b2d423e728bc294fb77c0d01b957c78848f (patch)
treed2ea6830d194c777a4b59f89bf3b9c66acdf9874 /core/mplayer.c
parente5f18eb82516a8d9e78185c9542d1e29e2819f18 (diff)
downloadmpv-e4837b2d423e728bc294fb77c0d01b957c78848f.tar.bz2
mpv-e4837b2d423e728bc294fb77c0d01b957c78848f.tar.xz
core: ignore backstep command if demuxer is not capable
Also, mark demuxer as not capable if DVD playback is done. The problem with DVD is that playback time (stream_pts) is not reported frame-exact, and the time is a "guess" at best.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 20838b9ff8..5d8976c491 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3590,7 +3590,8 @@ static void run_playloop(struct MPContext *mpctx)
if (mpctx->backstep_active) {
double current_pts = mpctx->last_vo_pts;
mpctx->backstep_active = false;
- if (mpctx->sh_video && current_pts != MP_NOPTS_VALUE) {
+ bool demuxer_ok = mpctx->demuxer && mpctx->demuxer->accurate_seek;
+ if (demuxer_ok && mpctx->sh_video && current_pts != MP_NOPTS_VALUE) {
double seek_pts = find_previous_pts(mpctx, current_pts);
if (seek_pts != MP_NOPTS_VALUE) {
queue_seek(mpctx, MPSEEK_ABSOLUTE, seek_pts, 1);
@@ -3617,9 +3618,11 @@ static void run_playloop(struct MPContext *mpctx)
// Note that current_pts should be part of the index,
// otherwise we can't find the previous frame, so set the
// seek target an arbitrary amount of time after it.
- mpctx->hrseek_pts = current_pts + 10.0;
- mpctx->hrseek_framedrop = false;
- mpctx->backstep_active = true;
+ if (mpctx->hrseek_active) {
+ mpctx->hrseek_pts = current_pts + 10.0;
+ mpctx->hrseek_framedrop = false;
+ mpctx->backstep_active = true;
+ }
} else {
mpctx->backstep_active = true;
}