diff utils.c @ 12108:c35d7bc64882 libavcodec

Add new decoder property max_lowres and do not init decoder if requested value is higher.
author cehoyos
date Wed, 07 Jul 2010 21:23:36 +0000
parents e8a29b278ebf
children cb3eb3a2fc96
line wrap: on
line diff
--- a/utils.c	Wed Jul 07 20:23:56 2010 +0000
+++ b/utils.c	Wed Jul 07 21:23:36 2010 +0000
@@ -506,6 +506,13 @@
     }
     avctx->frame_number = 0;
     if(avctx->codec->init){
+        if(avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
+           avctx->codec->max_lowres < avctx->lowres){
+            av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+                   avctx->codec->max_lowres);
+            goto free_and_end;
+        }
+
         ret = avctx->codec->init(avctx);
         if (ret < 0) {
             goto free_and_end;