summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-14 23:52:47 +0100
committerwm4 <wm4@nowhere>2014-11-15 00:55:30 +0100
commita6694d27889b4b65ab6d05641396724ae9696f77 (patch)
tree3c41306de3089dedd84378c7c3c3c8632ffdfe3a /options
parentd484cb3f3245573ec024d6a50099d9a5a5e4400d (diff)
downloadmpv-a6694d27889b4b65ab6d05641396724ae9696f77.tar.bz2
mpv-a6694d27889b4b65ab6d05641396724ae9696f77.tar.xz
demux_mkv: adjust subtitle preroll again (2)
Make the changes started in commit c827ae5f more eloborate, and provide an option to control the amount of data read before the seek-target. To achieve this, rewrite the loop that finds the lowest still acceptable target cluster. It is now searched by time instead of file position. The behavior (both with and without preroll option) may be different from before this change, although it shouldn't be worse. The change demux_mkv_read_cues() fixes a bug: when seeking after playing normally, the code would erroneously assume that durations are set. This doesn't happen if the first operation after loading was a seek instead of playback.
Diffstat (limited to 'options')
-rw-r--r--options/options.c3
-rw-r--r--options/options.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c
index c15482fd05..ba251f6216 100644
--- a/options/options.c
+++ b/options/options.c
@@ -301,6 +301,8 @@ const m_option_t mp_opts[] = {
OPT_FLAG("demuxer-mkv-subtitle-preroll", mkv_subtitle_preroll, 0),
OPT_FLAG("mkv-subtitle-preroll", mkv_subtitle_preroll, 0), // old alias
+ OPT_DOUBLE("demuxer-mkv-subtitle-preroll-secs", mkv_subtitle_preroll_secs,
+ M_OPT_MIN, .min = 0),
// ------------------------- subtitles options --------------------
@@ -670,6 +672,7 @@ const struct MPOpts mp_default_opts = {
.use_embedded_fonts = 1,
.sub_fix_timing = 1,
.sub_cp = "auto",
+ .mkv_subtitle_preroll_secs = 1.0,
.hwdec_codecs = "h264,vc1,wmv3",
diff --git a/options/options.h b/options/options.h
index f67a3a5c95..9284320f40 100644
--- a/options/options.h
+++ b/options/options.h
@@ -194,6 +194,7 @@ typedef struct MPOpts {
char *audio_demuxer_name;
char *sub_demuxer_name;
int mkv_subtitle_preroll;
+ double mkv_subtitle_preroll_secs;
double demuxer_min_secs_cache;
int cache_pausing;