]> git.sesse.net Git - vlc/commitdiff
MKV: fix playback of AC-3 with bogus default duration
authorSteve Lhomme <robUx4@videolabs.io>
Tue, 24 Feb 2015 11:04:49 +0000 (12:04 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 24 Feb 2015 12:18:09 +0000 (13:18 +0100)
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

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/matroska_segment_parse.cpp

index 1b07452e01a828b18f2608a194fe59daa3a00959..d0bd4edfd04fee490418037aa20fb889a3d97f64 100644 (file)
@@ -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" ) )