[vlc-commits] demux/mkv: only convert duration if it has a proper value

Filip Roséen git at videolan.org
Wed Oct 26 16:30:06 CEST 2016


vlc | branch: master | Filip Roséen <filip at atch.se> | Sat Oct 22 04:54:10 2016 +0200| [075c14f54a362f5560326fafef0da315da1ad0b0] | committer: Thomas Guillem

demux/mkv: only convert duration if it has a proper value

matroska_segment_c::i_duration defaults to having a value of "-1", and
we should of course not try to convert the duration from the unit
within an mkv to ours _unless_ we have initialized it (through the
value of a KaxDuration).

These changes fixes that.

Signed-off-by: Steve Lhomme <robux4 at videolabs.io>
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

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

diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index dcf201f..4eb0e7a 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -903,8 +903,8 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
 
     InfoHandlers::Dispatcher().iterate( m->begin(), m->end(), InfoHandlers::Payload( captures ) );
 
-    i_duration = mtime_t( static_cast<double>( i_duration * i_timescale ) / 10e5 );
-    if( !i_duration ) i_duration = -1;
+    if( i_duration != -1 )
+        i_duration = mtime_t( static_cast<double>( i_duration * i_timescale ) / 10e5 );
 }
 
 



More information about the vlc-commits mailing list