[vlc-commits] mkv: only jump on known chapters from chapter commands
Steve Lhomme
git at videolan.org
Thu Mar 17 17:07:09 CET 2016
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Mar 17 15:11:02 2016 +0100| [a0ace40b5c2bbffb037c5d35587896c0dd86b8eb] | committer: Jean-Baptiste Kempf
mkv: only jump on known chapters from chapter commands
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a0ace40b5c2bbffb037c5d35587896c0dd86b8eb
---
modules/demux/mkv/chapter_command.cpp | 14 +++++++-------
modules/demux/mkv/demux.cpp | 12 ++++--------
modules/demux/mkv/demux.hpp | 2 +-
3 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/modules/demux/mkv/chapter_command.cpp b/modules/demux/mkv/chapter_command.cpp
index 966c339..ab49ad5 100644
--- a/modules/demux/mkv/chapter_command.cpp
+++ b/modules/demux/mkv/chapter_command.cpp
@@ -308,9 +308,9 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
// find in the ChapProcessPrivate matching this Title level
p_vchapter = sys.BrowseCodecPrivate( 1, MatchTitleNumber, &i_title, sizeof(i_title), p_vsegment );
- if ( p_vsegment != NULL )
+ if ( p_vsegment != NULL && p_vchapter != NULL )
{
- sys.JumpTo( *p_vsegment, p_vchapter );
+ sys.JumpTo( *p_vsegment, *p_vchapter );
f_result = true;
}
@@ -351,9 +351,9 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
break;
}
p_vchapter = sys.BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1, p_vsegment );
- if ( p_vsegment != NULL )
+ if ( p_vsegment != NULL && p_vchapter != NULL )
{
- sys.JumpTo( *p_vsegment, p_vchapter );
+ sys.JumpTo( *p_vsegment, *p_vchapter );
f_result = true;
}
break;
@@ -410,7 +410,7 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
p_vchapter = p_vsegment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
if ( p_vchapter != NULL )
{
- sys.JumpTo( *p_vsegment, p_vchapter );
+ sys.JumpTo( *p_vsegment, *p_vchapter );
f_result = true;
}
}
@@ -454,7 +454,7 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
p_vchapter = p_vsegment->BrowseCodecPrivate( 1, MatchPgcType, &p_type, 1 );
if ( p_vchapter != NULL )
{
- sys.JumpTo( *p_vsegment, p_vchapter );
+ sys.JumpTo( *p_vsegment, *p_vchapter );
f_result = true;
}
}
@@ -496,7 +496,7 @@ bool dvd_command_interpretor_c::Interpret( const binary * p_command, size_t i_si
p_vchapter = p_vchapter->BrowseCodecPrivate( 1, MatchChapterNumber, &i_ptt, sizeof(i_ptt) );
if ( p_vchapter != NULL )
{
- sys.JumpTo( *p_vsegment, p_vchapter );
+ sys.JumpTo( *p_vsegment, *p_vchapter );
f_result = true;
}
}
diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index df51ba4..fa78186 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -799,7 +799,7 @@ bool demux_sys_t::PreparePlayback( virtual_segment_c *p_new_vsegment )
return true;
}
-void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c * p_vchapter )
+void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vchapter )
{
// if the segment is not part of the current segment, select the new one
if ( &vsegment != p_current_vsegment )
@@ -807,15 +807,11 @@ void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c * p_vc
PreparePlayback( &vsegment );
}
- if ( p_vchapter )
+ if ( !vchapter.p_chapter || !vchapter.p_chapter->Enter( true ) )
{
- if ( !p_vchapter->p_chapter || !p_vchapter->p_chapter->Enter( true ) )
- {
- // jump to the location in the found segment
- vsegment.Seek( demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
- }
+ // jump to the location in the found segment
+ vsegment.Seek( demuxer, vchapter.i_mk_virtual_start_time, &vchapter, -1 );
}
-
}
matroska_segment_c *demux_sys_t::FindSegment( const EbmlBinary & uid ) const
diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp
index 44e8bd4..519e85b 100644
--- a/modules/demux/mkv/demux.hpp
+++ b/modules/demux/mkv/demux.hpp
@@ -385,7 +385,7 @@ public:
void FreeUnused();
bool PreparePlayback( virtual_segment_c *p_new_vsegment );
matroska_stream_c *AnalyseAllSegmentsFound( demux_t *p_demux, EbmlStream *p_estream, bool b_initial = false );
- void JumpTo( virtual_segment_c & p_vsegment, virtual_chapter_c * p_vchapter );
+ void JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vchapter );
void InitUi();
void CleanUi();
More information about the vlc-commits
mailing list