Commit b26c2e4f authored by Filip Roséen's avatar Filip Roséen Committed by 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's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9d69cb37
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment