OSDN Git Service

ansi: stop using deprecated avcodec_set_dimensions
authorAnton Khirnov <anton@khirnov.net>
Sun, 27 Oct 2013 09:02:26 +0000 (10:02 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 31 Oct 2013 19:14:14 +0000 (20:14 +0100)
libavcodec/ansi.c

index ae67f3c..3f30ae9 100644 (file)
@@ -89,7 +89,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     s->bg          = DEFAULT_BG_COLOR;
 
     if (!avctx->width || !avctx->height)
-        avcodec_set_dimensions(avctx, 80<<3, 25<<4);
+        ff_set_dimensions(avctx, 80 << 3, 25 << 4);
 
     return 0;
 }
@@ -226,7 +226,9 @@ static int execute_code(AVCodecContext * avctx, int c)
         }
         if (width != avctx->width || height != avctx->height) {
             av_frame_unref(s->frame);
-            avcodec_set_dimensions(avctx, width, height);
+            ret = ff_set_dimensions(avctx, width, height);
+            if (ret < 0)
+                return ret;
             ret = ff_get_buffer(avctx, s->frame, AV_GET_BUFFER_FLAG_REF);
             if (ret < 0) {
                 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");