]> git.sesse.net Git - ffmpeg/commit
avformat/vorbiscomment: Switch to AVIOContext from bytestream API
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 28 Apr 2020 02:54:05 +0000 (04:54 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 3 May 2020 11:43:54 +0000 (13:43 +0200)
commit6397b4d6a241692a1c7bb611a3fd42b0de2d32b5
tree1a9f9efdbb428d1727d0b917e36ad9eb587d4d94
parent704d7c9f4616d71db1a1baa0a1726c77a9957521
avformat/vorbiscomment: Switch to AVIOContext from bytestream API

Up until now ff_vorbiscomment_write() used the bytestream API to write
VorbisComments. Therefore the caller had to provide a sufficiently large
buffer to write the output.

Yet two of the three callers (namely the FLAC and the Matroska muxer)
actually want the output to be written via an AVIOContext; therefore
they allocated buffers of the right size just for this purpose (i.e.
they get freed immediately afterwards). Only the Ogg muxer actually
wants a buffer. But given that it is easy to wrap a buffer into an
AVIOContext this commit changes ff_vorbiscomment_write() to use an
AVIOContext for its output.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/flacenc.c
libavformat/matroskaenc.c
libavformat/oggenc.c
libavformat/vorbiscomment.c
libavformat/vorbiscomment.h