aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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;