[vlc-devel] [PATCH 20/30] mkv: set p_sys->i_pts in a little bit cleaner way
Filip Roséen
filip at videolabs.io
Mon May 9 14:53:14 CEST 2016
No real change in terms of semantics, but the code is now (a little bit)
easier to read.
---
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 )
--
2.8.2
More information about the vlc-devel
mailing list