af_lavcac3enc: fix custom bitrates

Probably has been broken for ages.

(Not sure why anyone would use this feature, though.)
This commit is contained in:
wm4 2016-06-23 10:43:54 +02:00
parent b753c229f7
commit 31b73d5ca0
1 changed files with 3 additions and 2 deletions

View File

@ -319,14 +319,15 @@ static int af_open(struct af_instance* af){
if (s->cfg_bit_rate) {
int i;
for (i = 0; i < 19; i++) {
if (ac3_bitrate_tab[i] == s->cfg_bit_rate)
if (ac3_bitrate_tab[i] == s->cfg_bit_rate) {
s->bit_rate = ac3_bitrate_tab[i] * 1000;
break;
}
}
if (i >= 19) {
MP_WARN(af, "af_lavcac3enc unable set unsupported "
"bitrate %d, use default bitrate (check manpage to see "
"supported bitrates).\n", s->cfg_bit_rate);
s->cfg_bit_rate = 0;
}
}