From 1356755ad4618c05e282a65c0697075991b68fe2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 7 Nov 2015 17:37:32 +0100 Subject: demux_mkv: remove --demuxer-mkv-fix-timestamps While it seemed like a pretty good idea at first, it's just a dead end and works only in the simplest cases. While it may or may not help slightly with audio sync mode, the display-sync mode already compensates this in a better way. The main issue is that timestamps at this layer are not in order, so it can look at single timestamps only. --- demux/demux_mkv.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'demux') diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 9d0a294b02..733e441feb 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -203,7 +203,6 @@ struct demux_mkv_opts { double subtitle_preroll_secs; int probe_duration; int probe_start_time; - int fix_timestamps; }; const struct m_sub_options demux_mkv_conf = { @@ -214,14 +213,12 @@ const struct m_sub_options demux_mkv_conf = { OPT_CHOICE("probe-video-duration", probe_duration, 0, ({"no", 0}, {"yes", 1}, {"full", 2})), OPT_FLAG("probe-start-time", probe_start_time, 0), - OPT_FLAG("fix-timestamps", fix_timestamps, 0), {0} }, .size = sizeof(struct demux_mkv_opts), .defaults = &(const struct demux_mkv_opts){ .subtitle_preroll_secs = 1.0, .probe_start_time = 1, - .fix_timestamps = 0, }, }; @@ -2362,19 +2359,6 @@ exit: return res; } -static double fix_timestamp(demuxer_t *demuxer, mkv_track_t *track, double ts) -{ - mkv_demuxer_t *mkv_d = demuxer->priv; - if (demuxer->opts->demux_mkv->fix_timestamps && track->default_duration > 0) { - // Assume that timestamps have been rounded to the timecode scale. - double quant = MPMIN(mkv_d->tc_scale / 1e9, 0.001); - double rts = rint(ts / track->default_duration) * track->default_duration; - if (fabs(rts - ts) < quant) - ts = rts; - } - return ts; -} - static int handle_block(demuxer_t *demuxer, struct block_info *block_info) { mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; @@ -2397,7 +2381,7 @@ static int handle_block(demuxer_t *demuxer, struct block_info *block_info) return 0; } - current_pts = fix_timestamp(demuxer, track, tc / 1e9) - track->codec_delay; + current_pts = tc / 1e9 - track->codec_delay; if (track->type == MATROSKA_TRACK_AUDIO) { if (mkv_d->a_skip_to_keyframe) -- cgit v1.2.3