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
This commit is contained in:
Carl Eugen Hoyos
2010-07-07 21:23:36 +00:00
parent 38b0410902
commit 0fd0ef7947
20 changed files with 39 additions and 2 deletions

View File

@@ -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;