comparison utils.c @ 12489:8cd356429e9f libavcodec

Test lowres before codec init.
author cehoyos
date Mon, 13 Sep 2010 22:03:29 +0000
parents e9a1e1ba768f
children 94eaea836bf4
comparison
equal deleted inserted replaced
12488:351a81a23343 12489:8cd356429e9f
502 if(avctx->codec_id != codec->id || avctx->codec_type != codec->type){ 502 if(avctx->codec_id != codec->id || avctx->codec_type != codec->type){
503 av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n"); 503 av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n");
504 goto free_and_end; 504 goto free_and_end;
505 } 505 }
506 avctx->frame_number = 0; 506 avctx->frame_number = 0;
507 if (avctx->codec->max_lowres < avctx->lowres) {
508 av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
509 avctx->codec->max_lowres);
510 goto free_and_end;
511 }
512
507 if(avctx->codec->init){ 513 if(avctx->codec->init){
508 if (avctx->codec->max_lowres < avctx->lowres) {
509 av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
510 avctx->codec->max_lowres);
511 goto free_and_end;
512 }
513
514 ret = avctx->codec->init(avctx); 514 ret = avctx->codec->init(avctx);
515 if (ret < 0) { 515 if (ret < 0) {
516 goto free_and_end; 516 goto free_and_end;
517 } 517 }
518 } 518 }