[FFmpeg-devel] Patch to libavc/opus to create extradata if missing

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Mon Dec 28 11:53:53 EET 2020


Jonathan Baudanza:
> This patch to libavcodec/opus.c will create the opus extradata if it is missing. This is required when muxing opus data from an RTP demuxer. Without this patch, the opux muxer will fail with a "No extradata present" error. 
> 
> This issue was first reported by Juan Navarro here: http://www.ffmpeg-archive.org/Unable-to-record-VP8-Opus-from-RTP-SDP-td4689046.html
> 
> This patch was first created by Carl Eugen Hoyos, but didn't land because resulting opus files wouldn't play in VLC. The reason is because the opus headers in the original patch were too large. This patch update's Carl's original patch to limit the size of the extradata to 19 bytes.
>        
extradata is documented to be set/allocated by the user for decoders;
yet you intend to allocate it for a decoder. This might leak if the user
uses avcodec_close() (namely if the caller doesn't have any code to free
the extradata, believing there would be none, because this field is
documented not to be set by libavcodec when decoding). Maybe add Opus
support to extract_extradata instead?

- Andreas


More information about the ffmpeg-devel mailing list