[vlc-devel] [PATCH] MKV: don't use i_last_dts if it's invalid

Steve Lhomme robUx4 at videolabs.io
Mon Mar 16 09:17:18 CET 2015


---
 modules/demux/mkv/mkv.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index c7f6a44..dfb59d9 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -671,6 +671,8 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                 // condition when the DTS is correct (keyframe or B frame == NOT P frame)
                 if ( b_key_picture || b_discardable_picture )
                     p_block->i_dts = p_block->i_pts;
+                else if ( tk->i_last_dts == VLC_TS_INVALID )
+                    p_block->i_dts = i_pts;
                 else
                     p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )tk->i_default_duration );
             }
-- 
2.3.2




More information about the vlc-devel mailing list