aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-09 10:14:46 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-16 12:49:01 +0100
commit845020ed89caca12af3470289af9c9626e71e0ea (patch)
treed6d5e4888f05ec5189a42afcd91634aac5877ef1
parent4a8a35bc1ffe5a5f06393e81b8c22aa22fd28496 (diff)
downloadffmpeg-845020ed89caca12af3470289af9c9626e71e0ea.tar.gz
cljr: use the AVFrame API properly.
-rw-r--r--libavcodec/cljr.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c
index f6dbb768a0..ad0f729768 100644
--- a/libavcodec/cljr.c
+++ b/libavcodec/cljr.c
@@ -98,16 +98,18 @@ AVCodec ff_cljr_decoder = {
#endif
#if CONFIG_CLJR_ENCODER
-typedef struct CLJRContext {
- AVFrame picture;
-} CLJRContext;
-
static av_cold int encode_init(AVCodecContext *avctx)
{
- CLJRContext * const a = avctx->priv_data;
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
- avctx->coded_frame = &a->picture;
+ return 0;
+}
+static av_cold int encode_close(AVCodecContext *avctx)
+{
+ av_frame_free(&avctx->coded_frame);
return 0;
}
@@ -155,9 +157,9 @@ AVCodec ff_cljr_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLJR,
- .priv_data_size = sizeof(CLJRContext),
.init = encode_init,
.encode2 = encode_frame,
+ .close = encode_close,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE },
};