Skip to content

Commit 38681a7

Browse files
committed
lavc: set bitrate only if >0
Set the bitrate only if >0. Do not set if neither set explicitly nor by the codec preset - eg. for APV avg_bpp is intentionally set to 0. The libopenapv uses CQP by default and setting the bitrate explicitly disables that. Note that this setting doesn't do anything important - setting the AVCodecContext::bitrate to 0 does nothing. This change is avoid displaying "Setting bitrate to 0.0 bps." message.
1 parent a25392b commit 38681a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/video_compress/libavcodec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ bool set_codec_ctx_params(struct state_video_compress_libav *s, AVPixelFormat pi
919919
check_av_opt_set<double, true>(s->codec_ctx->priv_data, "crf",
920920
crf, "CRF");
921921
} else if (strcmp(s->codec_ctx->codec->name, "libopenh264") != 0) {
922-
set_bitrate = true;
922+
set_bitrate = bitrate > 0;
923923
}
924924
if (set_bitrate || params.requested_bitrate > 0) {
925925
s->codec_ctx->bit_rate = bitrate;

0 commit comments

Comments
 (0)