• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Move adding SeekEntry into end_ebml_master_crc32() · 4ed3c925
    Andreas Rheinhardt authored
    Up until now, SeekEntries were already added before
    start_ebml_master_crc32() was even called and before we were actually
    sure that we really write the element the SeekHead references: After
    all, we might also error out later; and given that the allocations
    implicit in dynamic buffers should be checked, end_ebml_master_crc32()
    will eventually have to return errors itself, so that it is the right
    place to add SeekHead entries.
    
    The earlier behaviour is of course a remnant of the time in which
    start_ebml_master_crc32() really did output something, so that the
    position before start_ebml_master_crc32() needed to be recorded.
    Erroring out later is also not as dangerous as it seems because in
    this case no SeekHead will be written (if it happened when writing
    the header, the whole muxing process would abort; if it happened
    when writing the trailer (when writing chapters not available initially),
    writing the trailer would be aborted and no SeekHead containing the
    bogus chapter entry would be written).
    
    This commit does not change the way the SeekEntries are added for those
    elements that are output preliminarily; this is so because the SeekHead
    is written before those elements are finally output and doing it
    otherwise would increase the amount of seeks.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    4ed3c925
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...