lavc: add avcodec_free_frame().

Since an AVFrame now has malloced members (extended_data), it must have
a destructor.
This commit is contained in:
Anton Khirnov
2012-09-21 09:07:02 +02:00
parent b437cec143
commit a42aadabc6
4 changed files with 33 additions and 2 deletions

View File

@@ -659,6 +659,21 @@ AVFrame *avcodec_alloc_frame(void)
return frame;
}
void avcodec_free_frame(AVFrame **frame)
{
AVFrame *f;
if (!frame || !*frame)
return;
f = *frame;
if (f->extended_data != f->data)
av_freep(&f->extended_data);
av_freep(frame);
}
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{
int ret = 0;