Revert "demux_mkv: don't trust DefaultDuration for audio"

This reverts commit 503c6f7fd6.

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.
This commit is contained in:
wm4 2016-03-30 11:34:35 +02:00
parent ec6e8a31e0
commit 1107a070e4
1 changed files with 5 additions and 3 deletions

View File

@ -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;