[vlc-commits] mkv: call PreparePlayback() when switching segment during seeking

Steve Lhomme git at videolan.org
Thu Mar 17 17:07:10 CET 2016


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

mkv: call PreparePlayback() when switching segment during seeking

it do the proper seek by itself

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

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

 modules/demux/mkv/virtual_segment.cpp |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index c237382..dbfce01 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -524,14 +524,22 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
             demuxer.info.i_seekpoint = p_vchapter->i_seekpoint_num - 1;
         }
 
-        if( &p_current_vchapter->segment != &p_vchapter->segment )
+        if( p_current_vchapter == NULL || &p_current_vchapter->segment != &p_vchapter->segment )
         {
-            KeepTrackSelection( p_current_vchapter->segment, p_vchapter->segment );
-            p_current_vchapter->segment.UnSelect();
-            p_vchapter->segment.Select( i_mk_date );
+            if ( p_current_vchapter )
+            {
+                KeepTrackSelection( p_current_vchapter->segment, p_vchapter->segment );
+                p_current_vchapter->segment.UnSelect();
+            }
+            msg_Dbg( &demuxer, "SWITCH CHAPTER uid=%" PRId64, p_vchapter->p_chapter ? p_vchapter->p_chapter->i_uid : 0 );
+            p_current_vchapter = p_vchapter;
+            p_sys->PreparePlayback( *this, i_mk_date );
+        }
+        else
+        {
+            p_current_vchapter = p_vchapter;
+            p_current_vchapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
         }
-        p_current_vchapter = p_vchapter;
-        p_vchapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
     }
 }
 



More information about the vlc-commits mailing list