]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/lclenc.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / lclenc.c
index 1dac307dd2e2e659f8886101118b3013e426b7b3..0afe5530ba4920f02589eda03a2e8decb61478d8 100644 (file)
@@ -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;
 }