[vlc-commits] mkv: only use the sub chapters duration if we don't have one or it' s bigger

Steve Lhomme git at videolan.org
Thu Mar 17 16:58:27 CET 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Mar 17 12:16:12 2016 +0100| [13013bb7c72333b9ad3774308ef69790d8754e82] | committer: Jean-Baptiste Kempf

mkv: only use the sub chapters duration if we don't have one or it's bigger

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

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

 modules/demux/mkv/virtual_segment.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 12732fc..512cf3d 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -75,7 +75,8 @@ virtual_chapter_c * virtual_chapter_c::CreateVirtualChapter( chapter_item_c * p_
         if( p_vsubchap )
             sub_chapters.push_back( p_vsubchap );
     }
-    int64_t stop = ( b_ordered )? tmp : p_chap->i_end_time;
+    int64_t stop = ( b_ordered && (p_chap->i_end_time == -1 ||
+                                   (p_chap->i_end_time - p_chap->i_start_time) < (tmp - usertime_offset) )) ? tmp : p_chap->i_end_time;
 
     virtual_chapter_c * p_vchap = new (std::nothrow) virtual_chapter_c( *p_segment, p_chap, start, stop, sub_chapters );
     if( !p_vchap )



More information about the vlc-commits mailing list