[vlc-devel] [PATCH] Send MKV Blocks laced as a block chain
Denis Charmet
typx at dinauz.org
Thu Feb 2 02:22:56 CET 2012
It avoids blocks with invalid pts/dts to be flagged as PREROLL if the
first block isn't. The demux already discards preroll audio packets.
Fix #5165
---
modules/demux/mkv/mkv.cpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index eedeba1..a7db329 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -484,6 +484,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
{
demux_sys_t *p_sys = p_demux->p_sys;
matroska_segment_c *p_segment = p_sys->p_current_segment->CurrentSegment();
+ block_t *p_first = NULL, *p_last = NULL;
if( !p_segment ) return;
@@ -636,11 +637,21 @@ msg_Dbg( p_demux, "block i_dts: %"PRId64" / i_pts: %"PRId64, p_block->i_dts, p_b
if( !tk->b_dts_only && ( i == 0 || p_block->i_pts > VLC_TS_INVALID ) )
p_block->i_pts += VLC_TS_0;
- es_out_Send( p_demux->out, tk->p_es, p_block );
+ if( !p_first )
+ {
+ p_first = p_block;
+ p_last = p_first;
+ }
+ else
+ {
+ p_last->p_next = p_block;
+ p_last = p_block;
+ }
/* use time stamp only for first block */
i_pts = VLC_TS_INVALID;
}
+ es_out_Send( p_demux->out, tk->p_es, p_first );
}
/*****************************************************************************
--
1.7.8.3
More information about the vlc-devel
mailing list