1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00
FFmpeg/tests/ref
Andreas Rheinhardt 358b58cb29 avformat/matroskaenc: Remove allocations for Attachments
If there are Attachments to write, the Matroska muxer currently
allocates two objects: An array that contains an entry for each
AttachedFile containing just the stream index of the corresponding
stream and the FileUID used for this AttachedFile; and a structure with
a pointer to said array and a counter for said array. These uids are
generated via code special to Attachments: It uses an AVLFG in the
normal and a sha of the attachment data in the bitexact case. (Said sha
requires an allocation, too.)

But now that an uid is generated for each stream in mkv_init(), there is
no need any more to use special code for generating the FileUIDs of
AttachedFiles: One can simply use the uid already generated for the
corresponding stream. And this makes the whole allocations of the
structures for AttachedFiles as well as the structures itself superfluous.
They have been removed.

In case AVFMT_FLAG_BITEXACT is set, the uids will be different from the
old ones which is the reason why the FATE-test lavf-mkv_attachment
needed to be updated. The old method had the drawback that two
AttachedFiles with the same data would have the same FileUID.
The new one doesn't.

Also notice that the dynamic buffer used to write the Attachments leaks
if an error happens when writing the buffer. By removing the
allocations potential sources of errors have been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-04-13 08:34:59 +02:00
..
acodec avformat/movenc: ensure we don't write the major brand as a compatible brand more than once 2019-12-21 11:57:28 -03:00
fate avformat/matroskaenc: Don't waste bytes writing durations 2020-04-13 08:08:42 +02:00
lavf avformat/matroskaenc: Remove allocations for Attachments 2020-04-13 08:34:59 +02:00
lavf-fate avformat/matroskaenc: Avoid allocations for SeekHead 2020-03-26 03:19:56 +01:00
pixfmt Merge commit '896fe15dbb7b78de495c4a7dd75e7faec66778da' 2019-03-14 14:31:48 -03:00
seek avformat/matroskaenc: Don't waste bytes writing durations 2020-04-13 08:08:42 +02:00
vsynth avformat/movenc: ensure we don't write the major brand as a compatible brand more than once 2019-12-21 11:57:28 -03:00
vsynth1
vsynth_lena