]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/gif.c
Deprecate avctx.coded_frame
[ffmpeg] / libavcodec / gif.c
index c6c37b6c66ba0ed743748ef0114f31a9f7f29f9f..a8c7f37d7f99c3ccd2b590fa967850539eff7add 100644 (file)
@@ -52,7 +52,7 @@
 
 #include "put_bits.h"
 
-typedef struct {
+typedef struct GIFContext {
     LZWState *lzw;
     uint8_t *buf;
 } GIFContext;
@@ -130,12 +130,12 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
 {
     GIFContext *s = avctx->priv_data;
 
-    avctx->coded_frame = av_frame_alloc();
-    if (!avctx->coded_frame)
-        return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
     avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     s->lzw = av_mallocz(ff_lzw_encode_state_size);
     if (!s->lzw)
@@ -174,8 +174,6 @@ static int gif_encode_close(AVCodecContext *avctx)
 {
     GIFContext *s = avctx->priv_data;
 
-    av_frame_free(&avctx->coded_frame);
-
     av_freep(&s->lzw);
     av_freep(&s->buf);
     return 0;