[vlc-commits] mkv: Fix multisegment ordered editions

Filip Roséen git at videolan.org
Sat May 7 20:33:40 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Fri May  6 19:08:40 2016 +0200| [0b172d938c2cd1aadfea04efe1bcd45569d639b8] | committer: Jean-Baptiste Kempf

mkv: Fix multisegment ordered editions

This patch restores the correct virtual stop time of a chapter.

[ originally submitted by Denis Charmet ]

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

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

 modules/demux/mkv/virtual_segment.cpp |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index b1e7508..8c72610 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -75,8 +75,11 @@ 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 && (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;
+    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 - p_chap->i_start_time + usertime_offset )
+            :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