[vlc-commits] mkv: fix missing Enter() on the first chapter used
Steve Lhomme
git at videolan.org
Tue Mar 15 10:41:19 CET 2016
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Mar 15 08:50:19 2016 +0100| [cfc1235f672ef5201bf374156c91343a9d613182] | committer: Jean-Baptiste Kempf
mkv: fix missing Enter() on the first chapter used
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cfc1235f672ef5201bf374156c91343a9d613182
---
modules/demux/mkv/virtual_segment.cpp | 10 ++++++++++
modules/demux/mkv/virtual_segment.hpp | 1 +
2 files changed, 11 insertions(+)
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index efb74a1..fa4703a 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -267,6 +267,7 @@ virtual_segment_c::virtual_segment_c( std::vector<matroska_segment_c*> * p_opene
i_current_edition = 0;
i_sys_title = 0;
p_current_chapter = NULL;
+ b_current_chapter_entered = false;
i_current_edition = p_segment->i_default_edition;
@@ -405,6 +406,12 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
bool b_has_seeked = false;
+ if ( !b_current_chapter_entered && p_current_chapter != NULL )
+ {
+ p_current_chapter->Enter( true );
+ b_current_chapter_entered = true;
+ }
+
if ( sys.i_pts != VLC_TS_INVALID )
p_cur_chapter = p_cur_edition->getChapterbyTimecode( sys.i_pts - VLC_TS_0 );
@@ -450,7 +457,10 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
{
/* TODO */
if ( !p_cur_edition->p_edition->EnterAndLeave( p_current_chapter->p_chapter, false ) )
+ {
p_current_chapter = NULL;
+ b_current_chapter_entered = false;
+ }
else
return true;
}
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index c192b22..4d5b942 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -116,6 +116,7 @@ public:
std::vector<virtual_edition_c*> editions;
std::vector<virtual_edition_c*>::size_type i_current_edition;
virtual_chapter_c *p_current_chapter;
+ bool b_current_chapter_entered;
int i_sys_title;
More information about the vlc-commits
mailing list