[vlc-commits] mkv: add cue position regardless of partial support or not
Filip Roséen
git at videolan.org
Mon May 23 16:22:01 CEST 2016
vlc | branch: master | Filip Roséen <filip at videolabs.io> | Sat May 21 02:17:56 2016 +0200| [b26c2e4f3389511a89dce3c30085677004575b13] | committer: Jean-Baptiste Kempf
mkv: add cue position regardless of partial support or not
Even though there are currently some type of cues that we cannot handle,
we should add the aprox. location denoted by such cues as a seekpoint to
optimize seeking.
Adding the location with Seekpoint::DISABLED means that we will never
seek directly to the position, but it can be used as a hint when looking
for an appropriate keyframe during the preparation for seeking.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b26c2e4f3389511a89dce3c30085677004575b13
---
modules/demux/mkv/matroska_segment.cpp | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 66198e5..99d6487 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -215,19 +215,18 @@ void matroska_segment_c::LoadCues( KaxCues *cues )
}
eparser.Up();
- if( likely( !b_invalid_cue ) && track_id != 0 && cue_mk_time != -1 && cue_position != static_cast<uint64_t>( -1 ) ) {
+ if( track_id != 0 && cue_mk_time != -1 && cue_position != static_cast<uint64_t>( -1 ) ) {
if( tracks.find( track_id ) != tracks.end() )
{
- for( tracks_map_t::iterator it = tracks.begin(); it != tracks.end(); ++it )
- {
- int const tlevel = SegmentSeeker::Seekpoint::QUESTIONABLE; // TODO: var_inheritBool( ..., "mkv-trust-cues" ) => TRUSTED;
- int const qlevel = SegmentSeeker::Seekpoint::QUESTIONABLE;
-
- int level = ( track_id == it->first ? tlevel : qlevel );
+ int level = SegmentSeeker::Seekpoint::DISABLED;
- _seeker.add_seekpoint( it->first, level, cue_position, cue_mk_time );
+ if( ! b_invalid_cue )
+ {
+ level = SegmentSeeker::Seekpoint::QUESTIONABLE; // TODO: var_InheritBool( ..., "mkv-trust-cues" );
}
+
+ _seeker.add_seekpoint( track_id, level, cue_position, cue_mk_time );
}
else
msg_Warn( &sys.demuxer, "Found cue with invalid track id = %u", track_id );
More information about the vlc-commits
mailing list