• Andreas Rheinhardt's avatar
    avformat/matroskadec: Accept more unknown-length elements · 3c70b941
    Andreas Rheinhardt authored
    The current Matroska specifications mandate that only two elements may
    use an unknown-length length: Segments and clusters. But this was not
    always so: For the greater part of Matroska's existence, all master
    elements were allowed to make use of the unknown-length feature.
    
    And there were muxers creating such files: For several years
    libavformat's Matroska muxer used unknown-length for all master
    elements when the output wasn't seekable. This only stopped in March
    2010 with 2529bb30. And even afterwards it was possible (albeit
    unlikely) for libavformat to create unknown-length master elements
    that are in violation of today's specifications, namely if the master
    element was so big that the seek backwards to update the size could
    no longer be performed inside the AVIOContext's write buffer. This
    has only been fixed in October 2016 (with the patches that introduced
    support for writing CRC-32 elements).
    
    Libavformat's Matroska demuxer meanwhile has never really supported
    unknown-length elements besides segments and clusters. Support for the
    latter was hardcoded. This commit changes this: Now all master elements
    for which a syntax to parse them is available are supported. This
    includes the files produced by old versions of libavformat's muxer.
    
    More precisely, master elements that have unknown length and are about
    to be parsed (not skipped) are supported; only a warning is emitted for
    them. For normal files, this means that level 1 elements after the
    clusters that are encountered after the clusters have been parsed (i.e.
    not because they are referenced by the seekhead at the beginning of the
    file) are still unsupported (they would be skipped at this point if
    their length were known).
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    3c70b941
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...
.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...