OSDN Git Service

avcodec/utils: implement avcodec_alloc_frame() through av_alloc_frame()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Dec 2013 13:03:38 +0000 (14:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Dec 2013 13:03:38 +0000 (14:03 +0100)
This ensures that theres just one AVFrame allocation function and libs dont
produce multiple AVFrame variants after a minor lib update

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index d738a86..972de72 100644 (file)
@@ -1067,15 +1067,7 @@ void avcodec_get_frame_defaults(AVFrame *frame)
 
 AVFrame *avcodec_alloc_frame(void)
 {
-    AVFrame *frame = av_malloc(sizeof(AVFrame));
-
-    if (frame == NULL)
-        return NULL;
-
-    frame->extended_data = NULL;
-    avcodec_get_frame_defaults(frame);
-
-    return frame;
+    return av_frame_alloc();
 }
 
 void avcodec_free_frame(AVFrame **frame)