Skip to content
  • Filip Roséen's avatar
    demux/mkv: abort EnsureDuration on non-finite elements · 46e632dd
    Filip Roséen authored and Thomas Guillem's avatar Thomas Guillem committed
    
    
    matroska_segment_c::EnsureDuration is used to calculate the duration
    for a stream which does not include the value as metadata. Given that
    the function potentially will have to run through the entire file in
    order to get the last timecode, these changes make sure that we abort
    if an element does not have a finite size.
    
    If an element, on the way, does not have a finite size we cannot
    simply jump over it, but have to parse it's entire contents (which
    might be an expensive operation). And most often when an element does
    not have a finite size, the media is being streamed.
    
    We however have an exception to infinite clusters that are referenced
    by a Cue, in which case we will try to parse it (to allow content
    saved from a live stream where the Cues refers to every cluster to
    have a duration).
    
    Signed-off-by: default avatarSteve Lhomme <robux4@videolabs.io>
    Signed-off-by: default avatarThomas Guillem <thomas@gllm.fr>
    46e632dd