summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-07-07 21:23:36 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-07-07 21:23:36 +0000
commit0fd0ef7947ad31b2e1b9506cb70d85dcfdf6cba6 (patch)
treec79745bc17e836f9438ae968085c2997a5f8c3a5 /libavcodec/utils.c
parent38b04109028fdeb4009f74e7467f90f3083a897a (diff)
Add new decoder property max_lowres and do not init decoder if requested value is higher.
Originally committed as revision 24098 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 902951137c..c3d701c74f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -506,6 +506,13 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
}
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;