MT#55283 EVS: fix lower bitrate clamp comparing against max_br

When the negotiated fmtp has a bitrate range (br=A-B), the encoder's
lower bound check compared the bitrate against max_br instead of
min_br. Any bitrate below the upper bound was therefore forced down
to the minimum, e.g. br=9.6-24.4 with the default 16.4 kbit/s ended
up encoding at 9.6 kbit/s instead of staying at 16.4.

Compare against min_br so the bitrate is only raised when it is
actually below the lower bound.

Closes #2223

Change-Id: I8bfaff332476e351e0b7a6a375a9c55bb3fa772f
(cherry picked from commit 0402477b96)
(cherry picked from commit e93604c0e2)
mr26.2.1
Dragos Oancea 3 weeks ago committed by Richard Fuchs
parent 294c82d404
commit f0908045f6

@ -992,7 +992,7 @@ static const char *evs_encoder_init(encoder_t *enc, const str *extra_opts) {
// EVS
if (o->max_br && enc->bitrate > o->max_br)
enc->bitrate = o->max_br;
if (o->min_br && enc->bitrate < o->max_br)
if (o->min_br && enc->bitrate < o->min_br)
enc->bitrate = o->min_br;
// verify bitrate

Loading…
Cancel
Save