[vlc-commits] MKV: fix COOK/ATRAC3 seeking

Steve Lhomme git at videolan.org
Thu Mar 19 12:13:10 CET 2015


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Mar 19 10:06:30 2015 +0000| [b2af2ff79ae80a85aa6698695488ae7cdc8b1843] | committer: Jean-Baptiste Kempf

MKV: fix COOK/ATRAC3 seeking

Fixes #14210

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/mkv.cpp  |    7 ++++---
 modules/demux/mkv/util.cpp |    7 +++++++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 0bce331..9a84a00 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -595,6 +595,10 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
         {
             memcpy( p_block->p_buffer, tk->p_compression_data->GetBuffer(), tk->p_compression_data->GetSize() );
         }
+
+        if ( b_key_picture )
+            p_block->i_flags |= BLOCK_FLAG_TYPE_I;
+
         switch( tk->fmt.i_codec )
         {
         case VLC_CODEC_COOK:
@@ -630,9 +634,6 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
             break;
         }
 
-        if ( b_key_picture )
-            p_block->i_flags |= BLOCK_FLAG_TYPE_I;
-        
         if( tk->fmt.i_cat != VIDEO_ES )
         {
             if ( tk->fmt.i_cat == NAV_ES )
diff --git a/modules/demux/mkv/util.cpp b/modules/demux/mkv/util.cpp
index 8f84d94..7a0cfcd 100644
--- a/modules/demux/mkv/util.cpp
+++ b/modules/demux/mkv/util.cpp
@@ -183,6 +183,13 @@ void handle_real_audio(demux_t * p_demux, mkv_track_t * p_tk, block_t * p_blk, m
                 p_sys->p_subpackets[i] = NULL;
             }
         p_sys->i_subpacket = 0;
+
+        if ( !( p_blk->i_flags & BLOCK_FLAG_TYPE_I) )
+        {
+            msg_Dbg( p_demux, "discard non-key preroll block in track %d at%"PRId64,
+                     p_tk->i_number, i_pts );
+            return;
+        }
     }
 
     if( p_tk->fmt.i_codec == VLC_CODEC_COOK ||



More information about the vlc-commits mailing list