summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-11-06 16:54:57 +0200
committerUoti Urpala <uau@mplayer2.org>2011-11-14 20:24:39 +0200
commit7b9908dda875db404604e87c8b762784d4f774d1 (patch)
tree226f35d1bec69356d18f087faf0a8515467daccf /mplayer.c
parent0aa8df2b7d95ba270394c1a1d2a11ccd73956a56 (diff)
downloadmpv-7b9908dda875db404604e87c8b762784d4f774d1.tar.bz2
mpv-7b9908dda875db404604e87c8b762784d4f774d1.tar.xz
options, core/hrseek: add --hr-seek-demuxer-offset
Some demuxers do not accurately seek to a keyframe before a given time but instead start too late. This means that precise seeks cannot work either. Most notably the libavformat mpeg demuxer exhibits this behavior depending on the file being played (with the internal mpeg demuxer precise seeks don't work at all). Add new option --hr-seek-demuxer-offset which can be used as a workaround with such demuxers. The value of the option is subtracted from the seek target position given to the demuxer when doing a precise seek.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index c13f56a143..eef8302aed 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3306,6 +3306,8 @@ static int seek(MPContext *mpctx, struct seek_params seek,
else if (seek.direction > 0)
demuxer_style |= SEEK_FORWARD;
+ if (hr_seek)
+ demuxer_amount -= opts->hr_seek_demuxer_offset;
int seekresult = demux_seek(mpctx->demuxer, demuxer_amount, audio_delay,
demuxer_style);
if (need_reset)