[vlc-devel] [PATCH 1/9] mkv: separate the segment selection from the track copying

Steve Lhomme robux4 at videolabs.io
Thu Mar 17 16:53:00 CET 2016


the order of UnSelect() and Select() is also inversed
---
 modules/demux/mkv/virtual_segment.cpp | 10 ++++++----
 modules/demux/mkv/virtual_segment.hpp |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 8c47e5f..f9e8f1e 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -522,7 +522,11 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
         }
 
         if( &p_current_vchapter->segment != &p_vchapter->segment )
-            ChangeSegment( p_current_vchapter->segment, p_vchapter->segment, i_mk_date );
+        {
+            ChangeSegment( p_current_vchapter->segment, p_vchapter->segment );
+            p_current_vchapter->segment.UnSelect();
+            p_vchapter->segment.Select( i_mk_date );
+        }
         p_current_vchapter = p_vchapter;
         p_vchapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
     }
@@ -656,7 +660,7 @@ void virtual_chapter_c::print()
 }
 #endif
 
-void virtual_segment_c::ChangeSegment( matroska_segment_c & old, matroska_segment_c & next, mtime_t i_mk_start_time )
+void virtual_segment_c::ChangeSegment( matroska_segment_c & old, matroska_segment_c & next )
 {
     size_t i, j;
     char *sub_lang = NULL, *aud_lang = NULL;
@@ -725,6 +729,4 @@ void virtual_segment_c::ChangeSegment( matroska_segment_c & old, matroska_segmen
             p_tk->b_forced = true;
         }
     }
-    next.Select( i_mk_start_time );
-    old.UnSelect();
 }
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index 320f4dd..04be7c8 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -162,7 +162,7 @@ public:
     void Seek( demux_t & demuxer, mtime_t i_mk_date,
                virtual_chapter_c *p_vchapter, int64_t i_global_position );
 private:
-    void ChangeSegment( matroska_segment_c & p_old, matroska_segment_c & p_new, mtime_t i_mk_start_time );
+    void ChangeSegment( matroska_segment_c & p_old, matroska_segment_c & p_new );
 };
 
 #endif
-- 
2.7.1



More information about the vlc-devel mailing list