Commit 5e598e57 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

MKV: do not read the whole Cluster data when seeking

Also pass the cluster to parse, because this interface change will be needed
for an upcoming patch.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 5dfb4af7
...@@ -706,7 +706,7 @@ bool matroska_segment_c::Preload( ) ...@@ -706,7 +706,7 @@ bool matroska_segment_c::Preload( )
cluster = (KaxCluster*)el; cluster = (KaxCluster*)el;
i_cluster_pos = i_start_pos = cluster->GetElementPosition(); i_cluster_pos = i_start_pos = cluster->GetElementPosition();
ParseCluster( ); ParseCluster( cluster );
ep->Down(); ep->Down();
/* stop pre-parsing the stream */ /* stop pre-parsing the stream */
...@@ -887,7 +887,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_ ...@@ -887,7 +887,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_
( i_index > 0 && ( i_index > 0 &&
p_indexes[i_index - 1].i_position < (int64_t)cluster->GetElementPosition() ) ) p_indexes[i_index - 1].i_position < (int64_t)cluster->GetElementPosition() ) )
{ {
ParseCluster(false); ParseCluster( cluster, false, SCOPE_NO_DATA );
IndexAppendCluster( cluster ); IndexAppendCluster( cluster );
} }
if( es.I_O().getFilePointer() >= (unsigned) i_global_position ) if( es.I_O().getFilePointer() >= (unsigned) i_global_position )
......
...@@ -158,7 +158,7 @@ private: ...@@ -158,7 +158,7 @@ private:
void ParseTracks( KaxTracks *tracks ); void ParseTracks( KaxTracks *tracks );
void ParseChapterAtom( int i_level, KaxChapterAtom *ca, chapter_item_c & chapters ); void ParseChapterAtom( int i_level, KaxChapterAtom *ca, chapter_item_c & chapters );
void ParseTrackEntry( KaxTrackEntry *m ); void ParseTrackEntry( KaxTrackEntry *m );
void ParseCluster( bool b_update_start_time = true ); void ParseCluster( KaxCluster *cluster, bool b_update_start_time = true, ScopeMode read_fully = SCOPE_ALL_DATA );
SimpleTag * ParseSimpleTags( KaxTagSimple *tag, int level = 50 ); SimpleTag * ParseSimpleTags( KaxTagSimple *tag, int level = 50 );
void IndexAppendCluster( KaxCluster *cluster ); void IndexAppendCluster( KaxCluster *cluster );
int32_t TrackInit( mkv_track_t * p_tk ); int32_t TrackInit( mkv_track_t * p_tk );
......
...@@ -1237,7 +1237,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters ) ...@@ -1237,7 +1237,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters )
} }
} }
void matroska_segment_c::ParseCluster( bool b_update_start_time ) void matroska_segment_c::ParseCluster( KaxCluster *cluster, bool b_update_start_time, ScopeMode read_fully )
{ {
EbmlElement *el; EbmlElement *el;
EbmlMaster *m; EbmlMaster *m;
...@@ -1252,7 +1252,7 @@ void matroska_segment_c::ParseCluster( bool b_update_start_time ) ...@@ -1252,7 +1252,7 @@ void matroska_segment_c::ParseCluster( bool b_update_start_time )
} }
try try
{ {
m->Read( es, EBML_CONTEXT(cluster), i_upper_level, el, true ); m->Read( es, EBML_CONTEXT(cluster), i_upper_level, el, true, read_fully );
} }
catch(...) catch(...)
{ {
......
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