From a6694d27889b4b65ab6d05641396724ae9696f77 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 14 Nov 2014 23:52:47 +0100 Subject: 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. --- options/options.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'options/options.c') 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", -- cgit v1.2.3