]> git.sesse.net Git - ffmpeg/commit
avformat/smacker: Read extradata directly into extradata
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 29 Mar 2020 04:40:57 +0000 (06:40 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 8 Apr 2020 13:53:04 +0000 (15:53 +0200)
commit7885c7357361c387bd63b797875dc6759eedd1bc
tree13212271b0d64ae3bc6d02adb2c8f6bd544506a9
parent3935c891e96c0819439da43d1b862652bbbdf065
avformat/smacker: Read extradata directly into extradata

The Smacker demuxer reads four consecutive 32bit values from the file
header into its demux context (as four uint32_t), converting it to
native endianness in the process and then writing these four values
later (after extradata has been allocated) to extradata as four 32bit
values (converting to little endian in the process).

This commit changes this: The stream and the extradata are allocated
earlier, so that the data destined for extradata can be read directly
into extradata.

Furthermore, given that these values are not needed for demuxing itself
they are now no longer kept as part of the demuxing context.

Finally, a check regarding the number of frames has been moved up,
too, in order to exit early before unnecessarily allocating the
stream and the extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/smacker.c