summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-07 22:01:17 +0200
committerwm4 <wm4@nowhere>2014-05-07 22:05:30 +0200
commitc57660fbf77eb29ddd2187f84b7450f601069b05 (patch)
treef7a1b130d349a914ebb7e32e5229c694479ae5da
parent2a783d70351f358d406641fa08448770bb1651f4 (diff)
downloadmpv-c57660fbf77eb29ddd2187f84b7450f601069b05.tar.bz2
mpv-c57660fbf77eb29ddd2187f84b7450f601069b05.tar.xz
options: add --hr-seek-framedrop option
This allows disabling of decoder framedrop during hr-seek. It's basically another useless option, but it will help exploring whether this framedropping really makes seeking faster, or whether disabling it helps with precise seeking (especially frame backstepping).
-rw-r--r--DOCS/man/en/input.rst3
-rw-r--r--DOCS/man/en/options.rst9
-rw-r--r--options/options.c2
-rw-r--r--options/options.h1
-rw-r--r--player/video.c3
5 files changed, 16 insertions, 2 deletions
diff --git a/DOCS/man/en/input.rst b/DOCS/man/en/input.rst
index 0e98731d96..568d7e737e 100644
--- a/DOCS/man/en/input.rst
+++ b/DOCS/man/en/input.rst
@@ -110,7 +110,8 @@ List of Input Commands
see the ``--hr-seek-demuxer-offset`` option). Video filters or other video
postprocessing that modifies timing of frames (e.g. deinterlacing) should
usually work, but might make backstepping silently behave incorrectly in
- corner cases.
+ corner cases. Using ``--hr-seek-framedrop=no`` should help, although it
+ might make precise seeking slower.
This does not work with audio-only playback.
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index bb178ce448..d4e51d172a 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -1078,6 +1078,15 @@ OPTIONS
the earlier demuxer position and the real target may be unnecessarily
decoded.
+``--hr-seek-framedrop=<yes|no>``
+ Allow the video decoder to drop frames during seek, if these frames are
+ before the seek target. If this is enabled, precise seeking can be faster,
+ but if you're using video filters which modify timestamps or add new
+ frames, it can lead to precise seeking skipping the target frame. This
+ e.g. can break frame backstepping when deinterlacing is enabled.
+
+ Default: ``yes``
+
``--http-header-fields=<field1,field2>``
Set custom HTTP fields when accessing HTTP stream.
diff --git a/options/options.c b/options/options.c
index e589bf8d61..5674c7dc0d 100644
--- a/options/options.c
+++ b/options/options.c
@@ -578,6 +578,7 @@ const m_option_t mp_opts[] = {
OPT_CHOICE("hr-seek", hr_seek, 0,
({"no", -1}, {"absolute", 0}, {"always", 1}, {"yes", 1})),
OPT_FLOATRANGE("hr-seek-demuxer-offset", hr_seek_demuxer_offset, 0, -9, 99),
+ OPT_FLAG("hr-seek-framedrop", hr_seek_framedrop, 0),
OPT_CHOICE_OR_INT("autosync", autosync, 0, 0, 10000,
({"no", -1})),
@@ -685,6 +686,7 @@ const struct MPOpts mp_default_opts = {
.ordered_chapters = 1,
.chapter_merge_threshold = 100,
.chapter_seek_threshold = 5.0,
+ .hr_seek_framedrop = 1,
.load_config = 1,
.position_resume = 1,
.stream_cache_min_percent = 20.0,
diff --git a/options/options.h b/options/options.h
index 6cad8b4e87..c9d0d82cf7 100644
--- a/options/options.h
+++ b/options/options.h
@@ -121,6 +121,7 @@ typedef struct MPOpts {
int initial_audio_sync;
int hr_seek;
float hr_seek_demuxer_offset;
+ int hr_seek_framedrop;
float audio_delay;
float default_max_pts_correction;
int autosync;
diff --git a/player/video.c b/player/video.c
index 688384d1de..128e2916ae 100644
--- a/player/video.c
+++ b/player/video.c
@@ -318,7 +318,8 @@ static int decode_image(struct MPContext *mpctx)
if (pkt && pkt->pts != MP_NOPTS_VALUE)
pkt->pts += mpctx->video_offset;
if ((pkt && pkt->pts >= mpctx->hrseek_pts - .005) ||
- d_video->has_broken_packet_pts)
+ d_video->has_broken_packet_pts ||
+ !mpctx->opts->hr_seek_framedrop)
{
mpctx->hrseek_framedrop = false;
}