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

Steve Lhomme git at videolan.org
Wed Feb 25 18:56:36 CET 2015


vlc/vlc-2.2 | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Feb 24 12:04:49 2015 +0100| [71b74cdc0f402184ff5eabcf390cca7b176ebf31] | committer: Jean-Baptiste Kempf

MKV: fix playback of AC-3 with bogus default duration

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 at videolan.org>
(cherry picked from commit 6cad286bb079a8d6caed5da3c4b2be6dbdfa7f9c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=71b74cdc0f402184ff5eabcf390cca7b176ebf31
---

 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 036403b..7792667 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1496,6 +1496,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" ) )



More information about the vlc-commits mailing list