Commit f2756634 authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

demux/mkv: do not calculate duration for infinite clusters

It does not make sense trying to calculate the duration for something
for which there is no end, as such we should protect ourselves from
wasting our breath.
Signed-off-by: Steve Lhomme's avatarSteve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 075c14f5
......@@ -686,7 +686,8 @@ bool matroska_segment_c::Preload( )
b_preloaded = true;
EnsureDuration();
if( cluster == NULL || cluster->IsFiniteSize() )
EnsureDuration();
return true;
}
......@@ -1026,6 +1027,12 @@ void matroska_segment_c::EnsureDuration()
return;
ParseCluster( p_last_cluster, false, SCOPE_PARTIAL_DATA );
if( p_last_cluster->IsFiniteSize() == false )
{
es.I_O().setFilePointer( i_current_position, seek_beginning );
return;
}
// use the last block + duration
uint64 i_last_timecode = p_last_cluster->GlobalTimecode();
for( unsigned int i = 0; i < p_last_cluster->ListSize(); i++ )
......
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