diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 00:40:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 00:51:01 +0100 |
commit | bfb1f44d246f4ed97d5cad9c1eace8a20951ff76 (patch) | |
tree | c865cd344c141c8ae89763db53682ad5bc8edc12 /libavcodec/cljr.c | |
parent | 21c41e76d7c1ddaadafc9da50e99db51358f3754 (diff) | |
parent | a639ea7f4bc44bf6bfa452675558a342924a66a9 (diff) | |
download | ffmpeg-bfb1f44d246f4ed97d5cad9c1eace8a20951ff76.tar.gz |
Merge commit 'a639ea7f4bc44bf6bfa452675558a342924a66a9'
* commit 'a639ea7f4bc44bf6bfa452675558a342924a66a9':
escape124: use the AVFrame API properly.
qtrle: use the AVFrame API properly.
cljr: use the AVFrame API properly.
cinepak: use the AVFrame API properly.
Conflicts:
libavcodec/cinepak.c
libavcodec/cljr.c
libavcodec/qtrle.c
See: 80e9e63c libavcodec/cinepak.c
See: 71c378984b0bd5470f67c424a79a4750f84d2d3e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cljr.c')
-rw-r--r-- | libavcodec/cljr.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 51ac10662a..7e0773b6be 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -99,16 +99,21 @@ AVCodec ff_cljr_decoder = { #if CONFIG_CLJR_ENCODER typedef struct CLJRContext { AVClass *avclass; - AVFrame picture; int dither_type; } 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; } @@ -183,6 +188,7 @@ AVCodec ff_cljr_encoder = { .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 }, .priv_class = &cljr_class, |