summaryrefslogtreecommitdiff
path: root/libavcodec/lclenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-17 11:41:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-17 11:46:51 +0100
commit85b7b0c519f8d9491b4c0340329a605cc97c8984 (patch)
tree7990305137bc5ece3e78f58218e67982853383ea /libavcodec/lclenc.c
parent92cbd775687204f9750a09c69f97702719036aab (diff)
parent0ea430c75b8d90449d2878ad84669a2da2ad3cbc (diff)
Merge commit '0ea430c75b8d90449d2878ad84669a2da2ad3cbc'
* commit '0ea430c75b8d90449d2878ad84669a2da2ad3cbc': lclenc: use the AVFrame API properly. Conflicts: libavcodec/lclenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/lclenc.c')
-rw-r--r--libavcodec/lclenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c
index 1dac307dd2..0afe5530ba 100644
--- a/libavcodec/lclenc.c
+++ b/libavcodec/lclenc.c
@@ -135,6 +135,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (!avctx->extradata)
return AVERROR(ENOMEM);
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
+
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ avctx->coded_frame->key_frame = 1;
+
c->compression = avctx->compression_level == FF_COMPRESSION_DEFAULT ?
COMP_ZLIB_NORMAL :
av_clip(avctx->compression_level, 0, 9);
@@ -176,6 +183,8 @@ static av_cold int encode_end(AVCodecContext *avctx)
av_freep(&avctx->extradata);
deflateEnd(&c->zstream);
+ av_frame_free(&avctx->coded_frame);
+
return 0;
}