• Andreas Rheinhardt's avatar
    avformat/matroskaenc: Don't fail if reserved Cues space doesn't suffice · 06f10890
    Andreas Rheinhardt authored
    When the user opted to write the Cues at the beginning, the Cues were
    simply written without checking in advance whether enough space has been
    reserved for them. If it wasn't enough, the data following the space
    reserved for the Cues was simply overwritten, corrupting the file.
    
    This commit changes this by checking whether enough space has been
    reserved for the Cues before outputting anything. If it isn't enough,
    no Cues will be output at all and the file will be finalized normally,
    yet writing the trailer will nevertheless return an error to notify
    the user that his wish of having Cues at the front of the file hasn't
    been fulfilled.
    
    This change opens new usecases for this option: It is now safe to use
    this option to e.g. record live streams or to use it when muxing the
    output of an expensive encoding, because when the reserved space turns
    out to be insufficient, one ends up with a file that just lacks Cues
    but is otherwise fine.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    06f10890
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...