libvpxenc: only force CBR if a bitrate is set
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Aug 2012 15:11:24 +0000 (17:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 17 Aug 2012 19:56:58 +0000 (21:56 +0200)
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libvpxenc.c

index 0b97907..b438301 100644 (file)
@@ -266,7 +266,7 @@ static av_cold int vp8_init(AVCodecContext *avctx)
         enccfg.g_pass = VPX_RC_ONE_PASS;
 
     if (avctx->rc_min_rate == avctx->rc_max_rate &&
-        avctx->rc_min_rate == avctx->bit_rate)
+        avctx->rc_min_rate == avctx->bit_rate && avctx->bit_rate)
         enccfg.rc_end_usage = VPX_CBR;
     else if (ctx->crf)
         enccfg.rc_end_usage = VPX_CQ;