]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/c93.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / c93.c
index b708659cca93b9dab6da400c5b2cc5261e07bdaf..3464c85e237f33abee160bbe3a6ec89c174bf967 100644 (file)
@@ -63,10 +63,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     s->pictures[0] = av_frame_alloc();
     s->pictures[1] = av_frame_alloc();
-    if (!s->pictures[0] || !s->pictures[1]) {
-        decode_end(avctx);
+    if (!s->pictures[0] || !s->pictures[1])
         return AVERROR(ENOMEM);
-    }
 
     return 0;
 }
@@ -138,7 +136,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 
     c93->currentpic ^= 1;
 
-    if ((ret = ff_reget_buffer(avctx, newpic)) < 0)
+    if ((ret = ff_reget_buffer(avctx, newpic, 0)) < 0)
         return ret;
 
     stride = newpic->linesize[0];
@@ -259,7 +257,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     return buf_size;
 }
 
-AVCodec ff_c93_decoder = {
+const AVCodec ff_c93_decoder = {
     .name           = "c93",
     .long_name      = NULL_IF_CONFIG_SMALL("Interplay C93"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -269,5 +267,5 @@ AVCodec ff_c93_decoder = {
     .close          = decode_end,
     .decode         = decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
-    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
 };