[vlc-devel] [PATCH] MKV: fix playback of AC-3 with bogus default duration

Steve Lhomme robUx4 at videolabs.io
Tue Feb 24 12:04:49 CET 2015


Fixes #8512
The fix is similar to that one in ffmpeg/libav http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/matroskadec.c;#l2813
---
 modules/demux/mkv/matroska_segment_parse.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index 1b07452..d0bd4ed 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1497,6 +1497,12 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
     }
     else if( !strcmp( p_tk->psz_codec, "A_AC3" ) )
     {
+        // the AC-3 default duration cannot be trusted, see #8512
+        if ( p_tk->fmt.audio.i_rate == 8000 )
+        {
+            p_tk->b_no_duration = true;
+            p_tk->i_default_duration = 0;
+        }
         p_tk->fmt.i_codec = VLC_CODEC_A52;
     }
     else if( !strcmp( p_tk->psz_codec, "A_EAC3" ) )
-- 
2.2.2




More information about the vlc-devel mailing list