summaryrefslogtreecommitdiffstats
path: root/demux/demux_mkv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-30 11:34:35 +0200
committerwm4 <wm4@nowhere>2016-03-30 11:34:35 +0200
commit1107a070e4f2a37fe59552d3c82b08e7aa522e1f (patch)
tree2791f1551ca6250f26e00b7e74fbfe909970dc85 /demux/demux_mkv.c
parentec6e8a31e092a1d5e162eaa81c538a81fb5c449a (diff)
downloadmpv-1107a070e4f2a37fe59552d3c82b08e7aa522e1f.tar.bz2
mpv-1107a070e4f2a37fe59552d3c82b08e7aa522e1f.tar.xz
Revert "demux_mkv: don't trust DefaultDuration for audio"
This reverts commit 503c6f7fd6c3c542667c93c75db260671c4ba982. There are situations where some decoders (MF apparently) always require a timestamp. Also, this makes bitrate estimation more granular than necessary. It seems it's better to try to detect fiels with broken default durations explicitly instead. Or maybe something should be added to smooth audio timestamps after filters.
Diffstat (limited to 'demux/demux_mkv.c')
-rw-r--r--demux/demux_mkv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index 5e6de8619d..b0a910bf68 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1687,9 +1687,11 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track)
sh_a->samplerate = 48000;
}
- // This field tends to be broken, and our decoder can interpolate the
- // missing timestamps anyway.
- track->default_duration = 0;
+ // Some files have broken default DefaultDuration set, which will lead to
+ // audio packets with incorrect timestamps. This follows FFmpeg commit
+ // 6158a3b, sample see FFmpeg ticket 2508.
+ if (sh_a->samplerate == 8000 && strcmp(codec, "ac3") == 0)
+ track->default_duration = 0;
sh_a->extradata = extradata;
sh_a->extradata_size = extradata_len;