[vlc-commits] mkv: don't enter anything when leaving the last ordered chapter

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


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

mkv: don't enter anything when leaving the last ordered chapter

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

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

 modules/demux/mkv/virtual_segment.cpp |   11 +++++++++--
 modules/demux/mkv/virtual_segment.hpp |    1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index db95889..c51163c 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -481,8 +481,7 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
             /* out of the scope of the data described by chapters, leave the edition */
             if ( p_cur_vedition->b_ordered && p_current_vchapter != NULL )
             {
-                /* TODO */
-                if ( !p_cur_vedition->p_edition->EnterAndLeave( p_current_vchapter->p_chapter, false ) )
+                if ( !p_current_vchapter->Leave( ) )
                 {
                     p_current_vchapter = NULL;
                     b_current_vchapter_entered = false;
@@ -494,6 +493,14 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
     return false;
 }
 
+bool virtual_chapter_c::Leave( )
+{
+    if( !p_chapter )
+        return false;
+
+    return p_chapter->Leave( true );
+}
+
 bool virtual_chapter_c::EnterAndLeave( virtual_chapter_c *p_leaving_vchapter, bool b_enter )
 {
     if( !p_chapter )
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index 2c83165..6991e0e 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -49,6 +49,7 @@ public:
                                                      int64_t & usertime_offset, bool b_ordered );
 
     virtual_chapter_c* getSubChapterbyTimecode( int64_t time );
+    bool Leave( );
     bool EnterAndLeave( virtual_chapter_c *p_leaving_vchapter, bool b_enter = true );
     virtual_chapter_c * FindChapter( int64_t i_find_uid );
     int PublishChapters( input_title_t & title, int & i_user_chapters, int i_level );



More information about the vlc-commits mailing list