Commit 04bad157 authored by michael's avatar michael

sanity checks


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3202 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 94fb7a56
......@@ -929,6 +929,16 @@ int MPV_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_INFO, "Warning min_rate > 0 but min_rate != max_rate isnt recommanded!\n");
}
if(avctx->rc_min_rate && avctx->rc_min_rate > avctx->bit_rate){
av_log(avctx, AV_LOG_INFO, "bitrate below min bitrate\n");
return -1;
}
if(avctx->rc_max_rate && avctx->rc_max_rate < avctx->bit_rate){
av_log(avctx, AV_LOG_INFO, "bitrate above max bitrate\n");
return -1;
}
if( s->avctx->rc_max_rate && s->avctx->rc_min_rate == s->avctx->rc_max_rate
&& (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO)
&& 90000LL * (avctx->rc_buffer_size-1) > s->avctx->rc_max_rate*0xFFFFLL){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment