summaryrefslogtreecommitdiff
path: root/ffmpeg/libavcodec/cljr.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavcodec/cljr.c')
-rw-r--r--ffmpeg/libavcodec/cljr.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/ffmpeg/libavcodec/cljr.c b/ffmpeg/libavcodec/cljr.c
index 2120864..7e0773b 100644
--- a/ffmpeg/libavcodec/cljr.c
+++ b/ffmpeg/libavcodec/cljr.c
@@ -87,28 +87,33 @@ static av_cold int decode_init(AVCodecContext *avctx)
AVCodec ff_cljr_decoder = {
.name = "cljr",
+ .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_CLJR,
.init = decode_init,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
};
#endif
#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;
}
@@ -168,7 +173,7 @@ static const AVOption options[] = {
{ NULL },
};
-static const AVClass class = {
+static const AVClass cljr_class = {
.class_name = "cljr encoder",
.item_name = av_default_item_name,
.option = options,
@@ -177,14 +182,15 @@ static const AVClass class = {
AVCodec ff_cljr_encoder = {
.name = "cljr",
+ .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 },
- .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
- .priv_class = &class,
+ .priv_class = &cljr_class,
};
#endif