[vlc-commits] mkv: set p_sys->i_pts in a little bit cleaner way

Filip Roséen git at videolan.org
Mon May 9 15:09:29 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Mon May  9 14:53:14 2016 +0200| [f1bf530aaab5b893bd039b3645f4bbffd1c21b9b] | committer: Jean-Baptiste Kempf

mkv: set p_sys->i_pts in a little bit cleaner way

No real change in terms of semantics, but the code is now (a little bit)
easier to read.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mkv/mkv.cpp |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 89a98bb..9b94474 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -733,11 +733,6 @@ static int Demux( demux_t *p_demux)
         return 0;
     }
 
-    if( simpleblock != NULL )
-        p_sys->i_pts = (mtime_t)simpleblock->GlobalTimecode() / INT64_C(1000);
-    else
-        p_sys->i_pts = (mtime_t)block->GlobalTimecode() / INT64_C(1000);
-    p_sys->i_pts += p_sys->i_mk_chapter_time + VLC_TS_0;
 
 
 
@@ -775,6 +770,14 @@ static int Demux( demux_t *p_demux)
         }
     }
 
+    /* set pts */
+    {
+        p_sys->i_pts = p_sys->i_mk_chapter_time + VLC_TS_0;
+
+        if( simpleblock != NULL ) p_sys->i_pts += simpleblock->GlobalTimecode() / INT64_C( 1000 );
+        else                      p_sys->i_pts +=       block->GlobalTimecode() / INT64_C( 1000 );
+    }
+
     if ( p_vsegment->CurrentEdition() &&
          p_vsegment->CurrentEdition()->b_ordered &&
          p_vsegment->CurrentChapter() == NULL )



More information about the vlc-commits mailing list