summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-07 17:37:32 +0100
committerwm4 <wm4@nowhere>2015-11-07 17:37:32 +0100
commit1356755ad4618c05e282a65c0697075991b68fe2 (patch)
treeda6c5620a8bdfb90d2bc846416414d7809003426 /demux
parent2dc18a2f82ad2f2a7fa1d97978cab9fc58d7a450 (diff)
downloadmpv-1356755ad4618c05e282a65c0697075991b68fe2.tar.bz2
mpv-1356755ad4618c05e282a65c0697075991b68fe2.tar.xz
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.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_mkv.c18
1 files changed, 1 insertions, 17 deletions
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)