[vlc-devel] [PATCH 9/9] mkv: don't enter anything when leaving the last ordered chapter
Steve Lhomme
robux4 at videolabs.io
Thu Mar 17 16:53:08 CET 2016
---
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 a2941d2..f59ff9a 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -478,8 +478,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;
@@ -491,6 +490,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 );
--
2.7.1
More information about the vlc-devel
mailing list