ffmpeg/tests/fate
Andreas Rheinhardt dc2f6b54ac avformat/matroskaenc: Avoid allocations for SeekHead
Up until e7ddafd5, the Matroska muxer wrote two SeekHeads: One at the
beginning referencing the main level 1 elements (i.e. not the Clusters)
and one at the end, referencing the Clusters. This second SeekHead was
useless and has therefore been removed. Yet the SeekHead-related
functions and structures are still geared towards this usecase: They
are built around an allocated array of variable size that gets
reallocated every time an element is added to it although the maximum
number of Seek entries is a small compile-time constant, so that one should
rather include the array in the SeekHead structure itself; and said
structure should be contained in the MatroskaMuxContext instead of being
allocated separately.

The earlier code reserved space for a SeekHead with 10 entries, although
we currently write at most 6. Reducing said number implied that every
Matroska/Webm file will be 84 bytes smaller and required to adapt
several FATE tests; furthermore, the reserved amount overestimated the
amount needed for for the SeekHead's length field and how many bytes
need to be reserved to write a EBML Void element, bringing the total
reduction to 89 bytes.

This also fixes a potential segfault: If !mkv->is_live and if the
AVIOContext is initially unseekable when writing the header, the
SeekHead is already written when writing the header and this used to
free the SeekHead-related structures that have been allocated. But if
the AVIOContext happens to be seekable when writing the trailer, it will
be attempted to write the SeekHead again which will lead to segfaults
because the corresponding structures have already been freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 03:19:56 +01:00
..
aac.mak
ac3.mak
acodec.mak
adpcm.mak
alac.mak
als.mak
amrnb.mak
amrwb.mak
api.mak
apng.mak
atrac.mak
audio.mak
bmp.mak
build.mak
canopus.mak
cbs.mak
cdxl.mak
checkasm.mak
concatdec.mak
cover-art.mak
dca.mak
demux.mak
dfa.mak
dnn.mak
dnxhd.mak
dpcm.mak
ea.mak
exif.mak
ffmpeg.mak
ffprobe.mak
fft.mak
fifo-muxer.mak
filter-audio.mak
filter-video.mak
fits.mak
flac.mak
flvenc.mak
gapless.mak
gif.mak
h264.mak
hap.mak
hevc.mak
hlsenc.mak
hw.mak
id3v2.mak
image.mak
indeo.mak
lavf-audio.mak
lavf-container.mak
lavf-image.mak
lavf-image2pipe.mak
lavf-video.mak
libavcodec.mak
libavdevice.mak
libavformat.mak
libavresample.mak
libavutil.mak
libswresample.mak
libswscale.mak
lossless-audio.mak
lossless-video.mak
matroska.mak avformat/matroskaenc: Avoid allocations for SeekHead 2020-03-26 03:19:56 +01:00
microsoft.mak
monkeysaudio.mak
mov.mak
mp3.mak
mpc.mak
mpeg4.mak
mpegps.mak
mpegts.mak
mxf.mak
opus.mak
pcm.mak
pixfmt.mak
pixlet.mak
probe.mak
prores.mak
qt.mak
qtrle.mak
real.mak
screen.mak
seek.mak
segment.mak
source-check.sh
source.mak
speedhq.mak
subtitles.mak
utvideo.mak
vcodec.mak
video.mak
voice.mak
vorbis.mak
vpx.mak
vqf.mak
wavpack.mak avformat/matroskaenc: Avoid allocations for SeekHead 2020-03-26 03:19:56 +01:00
wma.mak
xvid.mak