Commit 94313562 authored by Anton Khirnov's avatar Anton Khirnov

lavc: deprecate avcodec_free_frame()

av_frame_free() should be used instead.
parent eb891b31
...@@ -3112,6 +3112,7 @@ AVFrame *avcodec_alloc_frame(void); ...@@ -3112,6 +3112,7 @@ AVFrame *avcodec_alloc_frame(void);
*/ */
void avcodec_get_frame_defaults(AVFrame *frame); void avcodec_get_frame_defaults(AVFrame *frame);
#if FF_API_AVFRAME_LAVC
/** /**
* Free the frame and any dynamically allocated objects in it, * Free the frame and any dynamically allocated objects in it,
* e.g. extended_data. * e.g. extended_data.
...@@ -3121,8 +3122,12 @@ void avcodec_get_frame_defaults(AVFrame *frame); ...@@ -3121,8 +3122,12 @@ void avcodec_get_frame_defaults(AVFrame *frame);
* @warning this function does NOT free the data buffers themselves * @warning this function does NOT free the data buffers themselves
* (it does not know how, since they might have been allocated with * (it does not know how, since they might have been allocated with
* a custom get_buffer()). * a custom get_buffer()).
*
* @deprecated use av_frame_free()
*/ */
attribute_deprecated
void avcodec_free_frame(AVFrame **frame); void avcodec_free_frame(AVFrame **frame);
#endif
/** /**
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
......
...@@ -827,22 +827,12 @@ AVFrame *avcodec_alloc_frame(void) ...@@ -827,22 +827,12 @@ AVFrame *avcodec_alloc_frame(void)
return frame; return frame;
} }
#endif
void avcodec_free_frame(AVFrame **frame) void avcodec_free_frame(AVFrame **frame)
{ {
AVFrame *f; av_frame_free(frame);
if (!frame || !*frame)
return;
f = *frame;
if (f->extended_data != f->data)
av_freep(&f->extended_data);
av_freep(frame);
} }
#endif
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment