[FFmpeg-devel] [PATCH 1/3] avcodec: use av_frame_free() for coded_frame

Clément Bœsch u at pkh.me
Sat Feb 28 10:38:32 CET 2015


---
 libavcodec/avuienc.c            | 2 +-
 libavcodec/libopenjpegenc.c     | 4 ++--
 libavcodec/libtheoraenc.c       | 2 +-
 libavcodec/libutvideoenc.cpp    | 2 +-
 libavcodec/libvpxenc.c          | 2 +-
 libavcodec/proresenc_anatoliy.c | 2 +-
 libavcodec/proresenc_kostya.c   | 2 +-
 libavcodec/r210enc.c            | 2 +-
 libavcodec/utvideoenc.c         | 2 +-
 libavcodec/v210enc.c            | 2 +-
 libavcodec/v308enc.c            | 2 +-
 libavcodec/v408enc.c            | 2 +-
 libavcodec/v410enc.c            | 2 +-
 libavcodec/xfaceenc.c           | 2 +-
 libavcodec/y41penc.c            | 2 +-
 libavcodec/yuv4enc.c            | 2 +-
 16 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c
index 4b1b408..b91f782 100644
--- a/libavcodec/avuienc.c
+++ b/libavcodec/avuienc.c
@@ -99,7 +99,7 @@ static int avui_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int avui_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
index b5c04fd..95b0987 100644
--- a/libavcodec/libopenjpegenc.c
+++ b/libavcodec/libopenjpegenc.c
@@ -250,7 +250,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
 fail:
     opj_image_destroy(ctx->image);
     ctx->image = NULL;
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     return err;
 }
 
@@ -605,7 +605,7 @@ static av_cold int libopenjpeg_encode_close(AVCodecContext *avctx)
 
     opj_image_destroy(ctx->image);
     ctx->image = NULL;
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     return 0;
 }
 
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index 48f6c07..b4b395a 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -359,7 +359,7 @@ static av_cold int encode_close(AVCodecContext* avc_context)
 
     th_encode_free(h->t_state);
     av_freep(&h->stats);
-    av_freep(&avc_context->coded_frame);
+    av_frame_free(&avc_context->coded_frame);
     av_freep(&avc_context->stats_out);
     av_freep(&avc_context->extradata);
     avc_context->extradata_size = 0;
diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index b430a44..3b88fff 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -209,7 +209,7 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx)
 {
     UtVideoContext *utv = (UtVideoContext *)avctx->priv_data;
 
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     av_freep(&avctx->extradata);
     av_freep(&utv->buffer);
 
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 9ad0c54..69c3a45 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -253,7 +253,7 @@ static av_cold int vp8_free(AVCodecContext *avctx)
     if (ctx->is_alpha)
         vpx_codec_destroy(&ctx->encoder_alpha);
     av_freep(&ctx->twopass_stats.buf);
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     av_freep(&avctx->stats_out);
     free_frame_list(ctx->coded_frame_list);
     return 0;
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 801d58e..634ff08 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -601,7 +601,7 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
 static av_cold int prores_encode_close(AVCodecContext *avctx)
 {
     ProresContext* ctx = avctx->priv_data;
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     av_freep(&ctx->fill_y);
 
     return 0;
diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 59f73fb..c5561e9 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -1096,7 +1096,7 @@ static av_cold int encode_close(AVCodecContext *avctx)
     ProresContext *ctx = avctx->priv_data;
     int i;
 
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     if (ctx->tdata) {
         for (i = 0; i < avctx->thread_count; i++)
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index 07dfc50..b7d5a07 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -80,7 +80,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 355fdb1..99791ba 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -48,7 +48,7 @@ static av_cold int utvideo_encode_close(AVCodecContext *avctx)
     UtvideoContext *c = avctx->priv_data;
     int i;
 
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
     av_freep(&c->slice_bits);
     for (i = 0; i < 4; i++)
         av_freep(&c->slice_buffer[i]);
diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index b17bc2c..2e0fd43 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -215,7 +215,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c
index c6c5ac5..408784b 100644
--- a/libavcodec/v308enc.c
+++ b/libavcodec/v308enc.c
@@ -77,7 +77,7 @@ static int v308_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int v308_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c
index 20f08c7..cdb2efa 100644
--- a/libavcodec/v408enc.c
+++ b/libavcodec/v408enc.c
@@ -82,7 +82,7 @@ static int v408_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int v408_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index 0e2e82a..f2f7d73 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -81,7 +81,7 @@ static int v410_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int v410_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/xfaceenc.c b/libavcodec/xfaceenc.c
index 7edef1e..93abd46 100644
--- a/libavcodec/xfaceenc.c
+++ b/libavcodec/xfaceenc.c
@@ -223,7 +223,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int xface_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c
index 8f67944..4778618 100644
--- a/libavcodec/y41penc.c
+++ b/libavcodec/y41penc.c
@@ -84,7 +84,7 @@ static int y41p_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int y41p_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c
index ed0fc77..5ce4846 100644
--- a/libavcodec/yuv4enc.c
+++ b/libavcodec/yuv4enc.c
@@ -74,7 +74,7 @@ static int yuv4_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int yuv4_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
-- 
2.3.1



More information about the ffmpeg-devel mailing list