]> git.sesse.net Git - ffmpeg/commit
avformat/smacker: Stop caching and copying audio frames
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 23 Jun 2020 15:23:57 +0000 (17:23 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 4 Jul 2020 17:19:34 +0000 (19:19 +0200)
commit316dc0674eeb3419e560913ac9bc130b6dae919a
tree752e9c333192e1b72e764ff66cb41c5003f9b9f6
parent2f687bc83e87cd289fafcebd026fe7f586f86332
avformat/smacker: Stop caching and copying audio frames

The layout of a Smacker frame is as follows: For some frames, the
beginning of the frame contained a palette for the video stream; then
there are potentially several audio frames, followed by the data for the
video stream.

The Smacker demuxer used to read the palette, then cache every audio frame
into a buffer (that gets reallocated to the desired size every time a
frame is read into this buffer), then read and return the video frame
(together with the palette). The cached audio frames are then returned
by copying the data into freshly allocated buffers; if there are none
left, the next frame is read.

This commit changes this: At the beginning of a frame, the palette is
read and cached as now. But audio frames are no longer cached at all;
they are returned immediately. This gets rid of copying and also allows
to remove the code for the buffer-to-AVStream correspondence.

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