[vlc-commits] MKV: Use frame defaut duration for MKV lace pts

Denis Charmet git at videolan.org
Fri Feb 17 00:48:03 CET 2012


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Thu Feb 16 22:57:21 2012 +0100| [562813603621bf160868d355f30def8e0a10029a] | committer: Jean-Baptiste Kempf

MKV: Use frame defaut duration for MKV lace pts

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 at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=562813603621bf160868d355f30def8e0a10029a
---

 modules/demux/mkv/mkv.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 7be24c8..e8a67ea 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -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;
     }
 }
 



More information about the vlc-commits mailing list