Commit 2f195839 authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

2enc: clip and warn when user bitrate set too low

The encoder crashed on verly low bitrates since there wasn't enough
space allocated.
Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent 6e5c6d61
......@@ -1180,8 +1180,8 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx)
avctx->bit_rate = av_rescale(min_bits_per_frame, avctx->time_base.den,
avctx->time_base.num);
av_log(avctx, AV_LOG_WARNING,
"Bitrate too low, clipping to minimum = %.2lf Mbps!\n",
(double)avctx->bit_rate/1000000.0f);
"Bitrate too low, clipping to minimum = %li Mbps!\n",
avctx->bit_rate/1000000);
}
return 0;
......
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