]> git.sesse.net Git - vlc/commitdiff
MKV: Use frame defaut duration for MKV lace pts
authorDenis Charmet <typx@dinauz.org>
Thu, 16 Feb 2012 21:57:21 +0000 (22:57 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 16 Feb 2012 23:47:50 +0000 (00:47 +0100)
This is used in many other MKV demux and prevents the pts = dts = 0 in every lace.
Fix #5165

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/mkv.cpp

index 7be24c88c7f08d5a33c6a3f4bee71248f9effe45..e8a67ea0dcb0a5bc82b3b2f899f58b2b7c50b563 100644 (file)
@@ -617,7 +617,7 @@ void BlockDecode( demux_t *p_demux, KaxBlock *block, KaxSimpleBlock *simpleblock
                 if ( f_mandatory )
                     p_block->i_dts = p_block->i_pts;
                 else
-                    p_block->i_dts = min( i_pts, tk->i_last_dts + (mtime_t)(tk->i_default_duration >> 10));
+                    p_block->i_dts = min( i_pts, tk->i_last_dts + ( mtime_t )( tk->i_default_duration / 1000 ) );
             }
         }
         tk->i_last_dts = p_block->i_dts;
@@ -639,7 +639,9 @@ msg_Dbg( p_demux, "block i_dts: %"PRId64" / i_pts: %"PRId64, p_block->i_dts, p_b
         es_out_Send( p_demux->out, tk->p_es, p_block );
 
         /* use time stamp only for first block */
-        i_pts = VLC_TS_INVALID;
+        i_pts = ( tk->i_default_duration )?
+                 i_pts + ( mtime_t )( tk->i_default_duration / 1000 ):
+                 VLC_TS_INVALID;
     }
 }