]> git.sesse.net Git - vlc/commitdiff
MKV: don't use i_last_dts if it's invalid
authorSteve Lhomme <robUx4@videolabs.io>
Mon, 16 Mar 2015 08:17:18 +0000 (09:17 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 16 Mar 2015 09:11:30 +0000 (10:11 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/mkv.cpp

index 5e183b9912f6c857ac1b60bb2608f9d56f19d8ed..02693933479a77abaa7655a4d7eb25b74669dd61 100644 (file)
@@ -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 );
             }