[vlc-commits] mkv: only the first loaded segment knows which chapter it will start from

Steve Lhomme git at videolan.org
Thu Mar 17 23:56:04 CET 2016


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Mar 17 17:47:16 2016 +0100| [d1a4ba9346f64ca03f44e91a7f2c29aa26cc3c34] | committer: Jean-Baptiste Kempf

mkv: only the first loaded segment knows which chapter it will start from

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

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

 modules/demux/mkv/demux.cpp           |    5 +++++
 modules/demux/mkv/virtual_segment.cpp |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index 144566b..ca50504 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -661,6 +661,11 @@ bool demux_sys_t::PreloadLinked()
     if ( !p_current_vsegment )
         return false;
 
+    /* Set current chapter */
+    p_current_vsegment->p_current_vchapter = p_current_vsegment->veditions[p_current_vsegment->i_current_edition]->getChapterbyTimecode(0);
+    msg_Dbg( &demuxer, "NEW START CHAPTER uid=%" PRId64, p_current_vsegment->p_current_vchapter && p_current_vsegment->p_current_vchapter->p_chapter ?
+                 p_current_vsegment->p_current_vchapter->p_chapter->i_uid : 0 );
+
     used_vsegments.push_back( p_current_vsegment );
 
     for ( i=1; i< opened_segments.size(); i++ )
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index c51163c..f59ff9a 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -320,9 +320,6 @@ virtual_segment_c::virtual_segment_c( matroska_segment_c & main_segment, std::ve
             break;
         }
     }
-    /* Set current chapter */
-    p_current_vchapter = veditions[i_current_edition]->getChapterbyTimecode(0);
-
 }
 
 virtual_segment_c::~virtual_segment_c()



More information about the vlc-commits mailing list