• Andreas Rheinhardt's avatar
    avformat/matroskadec: Improve handling of circular SeekHeads · 7e910353
    Andreas Rheinhardt authored
    There can be more than one SeekHead in a Matroska file, but most of the
    other level 1 elements can only occur once.* Therefore the Matroska
    demuxer only allows one entry per ID in its internal list of level 1
    elements known to it; the only exception to this are SeekHeads.
    
    The only exception to this are SeekHeads: When one is encountered
    (either directly or in the list of entries read from SeekHeads),
    a new entry in the list of known level-1 elements is always added,
    even when this entry is actually already known.
    
    This leads to lots of seeks in case of circular SeekHeads: Each time a
    SeekHead is parsed, a new entry for a SeekHead will be added to the list
    of entries read from SeekHeads. The exception for SeekHeads mentioned
    above now implies that this SeekHead will always appear new and unparsed
    and parsing will be attempted. This continued until the list of known
    level-1 elements is full.
    
    Fixing this is pretty simple: Don't add a new entry for a SeekHead if
    its position matches the position of an already known SeekHead.
    
    *: Actually, there can be multiple Tags and several other level 1
    elements are "identically recurring" which means they may be resent
    multiple times, but each instance must be absolutely identical to the
    previous.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    7e910353
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...