[vlc-devel] [PATCH] MKV: fix COOK/ATRAC3 seeking (v2)
Steve Lhomme
robUx4 at videolabs.io
Thu Mar 19 12:06:30 CET 2015
Fixes #14210
---
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 48496e2..e6eb2ed 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 ||
--
2.3.2
More information about the vlc-devel
mailing list