]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/photocd.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / photocd.c
index 8fd4536a650bf43b48f70c4adb760158cd4074e4..f95d5a8eb87a809761141b0bf3a0ae55cc443c08 100644 (file)
@@ -323,8 +323,9 @@ static int photocd_decode_frame(AVCodecContext *avctx, void *data,
     else
         s->resolution = av_clip(4 - s->lowres, 0, 4);
 
-    avctx->width  = img_info[s->resolution].width;
-    avctx->height = img_info[s->resolution].height;
+    ret = ff_set_dimensions(avctx, img_info[s->resolution].width, img_info[s->resolution].height);
+    if (ret < 0)
+        return ret;
 
     if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
@@ -457,7 +458,7 @@ static const AVClass photocd_class = {
     .version    = LIBAVUTIL_VERSION_INT,
 };
 
-AVCodec ff_photocd_decoder = {
+const AVCodec ff_photocd_decoder = {
     .name           = "photocd",
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_PHOTOCD,
@@ -468,4 +469,5 @@ AVCodec ff_photocd_decoder = {
     .decode         = photocd_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
     .long_name      = NULL_IF_CONFIG_SMALL("Kodak Photo CD"),
+    .caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE,
 };