]> git.sesse.net Git - ffmpeg/commitdiff
lavc: deprecate avcodec_free_frame()
authorAnton Khirnov <anton@khirnov.net>
Fri, 29 Nov 2013 20:43:56 +0000 (21:43 +0100)
committerAnton Khirnov <anton@khirnov.net>
Wed, 11 Dec 2013 19:39:54 +0000 (20:39 +0100)
av_frame_free() should be used instead.

libavcodec/avcodec.h
libavcodec/utils.c

index 4ce6d61cd2400ca9eab22382075244a1f30bfa33..7836ae2f97a4c6a9b4e7be85990d06cdb99b81cc 100644 (file)
@@ -3112,6 +3112,7 @@ AVFrame *avcodec_alloc_frame(void);
  */
 void avcodec_get_frame_defaults(AVFrame *frame);
 
+#if FF_API_AVFRAME_LAVC
 /**
  * Free the frame and any dynamically allocated objects in it,
  * e.g. extended_data.
@@ -3121,8 +3122,12 @@ void avcodec_get_frame_defaults(AVFrame *frame);
  * @warning this function does NOT free the data buffers themselves
  * (it does not know how, since they might have been allocated with
  *  a custom get_buffer()).
+ *
+ * @deprecated use av_frame_free()
  */
+attribute_deprecated
 void avcodec_free_frame(AVFrame **frame);
+#endif
 
 /**
  * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
index 89d78ddda0b726cfc604bd045acf031d90040aaa..25f16c0a26ea3b9a1302dc17ca3bc9b8752cef89 100644 (file)
@@ -827,22 +827,12 @@ AVFrame *avcodec_alloc_frame(void)
 
     return frame;
 }
-#endif
 
 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);
+    av_frame_free(frame);
 }
+#endif
 
 int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options)
 {