aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2015-05-23 14:24:34 -0300
committerJames Almer <jamrial@gmail.com>2015-05-23 14:46:46 -0300
commit8952254ffe7f43a967a3be5fdd40e48d899c2e01 (patch)
treeda4b6e4824f3a88ee2a20299b2a4cceb4c961110 /libavcodec
parent57d9788d1b06eb4a410ce27f3b589fdc847a21d5 (diff)
downloadffmpeg-8952254ffe7f43a967a3be5fdd40e48d899c2e01.tar.gz
libwebp: simplify AVCodec.close functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libwebpenc.c5
-rw-r--r--libavcodec/libwebpenc_animencoder.c11
-rw-r--r--libavcodec/libwebpenc_common.c7
-rw-r--r--libavcodec/libwebpenc_common.h2
4 files changed, 9 insertions, 16 deletions
diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c
index 4c22a9b04a..db96e1637b 100644
--- a/libavcodec/libwebpenc.c
+++ b/libavcodec/libwebpenc.c
@@ -80,7 +80,10 @@ end:
static int libwebp_encode_close(AVCodecContext *avctx)
{
- return ff_libwebp_encode_close_common(avctx);
+ LibWebPContextCommon *s = avctx->priv_data;
+ av_frame_free(&s->ref);
+
+ return 0;
}
static const AVClass class = {
diff --git a/libavcodec/libwebpenc_animencoder.c b/libavcodec/libwebpenc_animencoder.c
index c1e2a1cb9a..e9582016d3 100644
--- a/libavcodec/libwebpenc_animencoder.c
+++ b/libavcodec/libwebpenc_animencoder.c
@@ -116,12 +116,11 @@ end:
static int libwebp_anim_encode_close(AVCodecContext *avctx)
{
- int ret = ff_libwebp_encode_close_common(avctx);
- if (!ret) {
- LibWebPAnimContext *s = avctx->priv_data;
- WebPAnimEncoderDelete(s->enc);
- }
- return ret;
+ LibWebPAnimContext *s = avctx->priv_data;
+ av_frame_free(&s->cc.ref);
+ WebPAnimEncoderDelete(s->enc);
+
+ return 0;
}
static const AVClass class = {
diff --git a/libavcodec/libwebpenc_common.c b/libavcodec/libwebpenc_common.c
index 373adca756..a76b6da5d6 100644
--- a/libavcodec/libwebpenc_common.c
+++ b/libavcodec/libwebpenc_common.c
@@ -252,10 +252,3 @@ int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s,
end:
return ret;
}
-
-int ff_libwebp_encode_close_common(AVCodecContext *avctx)
-{
- LibWebPContextCommon *s = avctx->priv_data;
- av_frame_free(&s->ref);
- return 0;
-}
diff --git a/libavcodec/libwebpenc_common.h b/libavcodec/libwebpenc_common.h
index 7e653dab2b..e74e57939e 100644
--- a/libavcodec/libwebpenc_common.h
+++ b/libavcodec/libwebpenc_common.h
@@ -57,8 +57,6 @@ int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s,
const AVFrame *frame, AVFrame **alt_frame_ptr,
WebPPicture **pic_ptr);
-int ff_libwebp_encode_close_common(AVCodecContext *avctx);
-
#define OFFSET(x) offsetof(LibWebPContextCommon, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {