• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Write level 1 elements in one go · d9c21ec6
    Andreas Rheinhardt authored
    Up until now, writing level 1 elements proceeded as follows: First, the
    element id was written to the ordinary output AVIOContext and a dynamic
    buffer was opened for the content of the level 1 element in
    start_ebml_master_crc32(). Then this buffer was actually used and after it
    was closed (in end_ebml_master_crc32()), the size field corresponding to
    the buffer's size was written, after which the actual data was written.
    
    This commit changes this: Nothing is written to the main AVIOContext any
    more in start_ebml_master_crc32(). end_ebml_master_crc32() now writes
    both the id, the length field as well as the data. This implies that
    one can start a level 1 element in memory without outputting anything.
    This is done to enable to test whether enough space has been reserved
    for the Cues (if space has been reserved for them) before writing them.
    A large duration between outputting the header and outputting the rest
    could also break certain streaming usecases like the one from #8578
    (which this commit fixes).
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    d9c21ec6
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...