[vlc-commits] mkv: replaced loop with (already present) helper
Filip Roséen
git at videolan.org
Wed Mar 9 12:59:41 CET 2016
vlc | branch: master | Filip Roséen <filip at videolabs.io> | Wed Mar 9 12:49:59 2016 +0100| [d6f4169b426081209e83e0c92153d92236b5346e] | committer: Jean-Baptiste Kempf
mkv: replaced loop with (already present) helper
BlockFindTrackIndex does what the explicit loop is doing; we should use
it.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d6f4169b426081209e83e0c92153d92236b5346e
---
modules/demux/mkv/matroska_segment.cpp | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 838cb14..052c4a1 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -979,19 +979,12 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
return;
}
- /* check if block's track is in our list */
- for( i_track = 0; i_track < tracks.size(); i_track++ )
- {
- if( (simpleblock && tracks[i_track]->i_number == simpleblock->TrackNum()) ||
- (block && tracks[i_track]->i_number == block->TrackNum()) )
- break;
- }
-
if( simpleblock )
i_mk_pts = sys.i_mk_chapter_time + simpleblock->GlobalTimecode() / INT64_C(1000);
else
i_mk_pts = sys.i_mk_chapter_time + block->GlobalTimecode() / INT64_C(1000);
- if( i_track < tracks.size() )
+
+ if( BlockFindTrackIndex( &i_track, block, simpleblock ) == VLC_SUCCESS )
{
if( tracks[i_track]->fmt.i_cat == i_cat && b_key_picture )
{
More information about the vlc-commits
mailing list