demux_mkv: document probe-start-time option and enable it by default

This is useful with live streams, and it's not much worse than the h264
first packet hack, which reads some data anyway.

For some reason, the option wasn't even documented, so do that.

In addition, print the start time even if it's negative. That should not
be possible, but for some reason, the field is an int64_t copied from an
uint64_t so... whatever. Keeping the logging slightly more straight
forward is better anyway.
This commit is contained in:
wm4 2020-02-27 22:29:40 +01:00
parent b56e2efd5f
commit 05564af1ac
2 changed files with 8 additions and 1 deletions

View File

@ -3406,6 +3406,12 @@ Demuxer
``--demuxer-mkv-subtitle-preroll-secs-index=<value>``
See ``--demuxer-mkv-subtitle-preroll``.
``--demuxer-mkv-probe-start-time=<yes|no>``
Check the start time of Matroska files (default: yes). This simply reads the
first cluster timestamps and assumes it is the start time. Technically, this
also reads the first timestamp, which may increase latency by one frame
(which may be relevant for live streams).
``--demuxer-mkv-probe-video-duration=<yes|no|full>``
When opening the file, seek to the end of it, and check what timestamp the
last video packet has, and report that as file duration. This is strictly

View File

@ -244,6 +244,7 @@ const struct m_sub_options demux_mkv_conf = {
.subtitle_preroll = 2,
.subtitle_preroll_secs = 1.0,
.subtitle_preroll_secs_index = 10.0,
.probe_start_time = 1,
},
};
@ -3211,7 +3212,7 @@ static void probe_first_timestamp(struct demuxer *demuxer)
demuxer->start_time = mkv_d->cluster_tc / 1e9;
if (demuxer->start_time > 0)
if (demuxer->start_time)
MP_VERBOSE(demuxer, "Start PTS: %f\n", demuxer->start_time);
}