mirror of https://git.ffmpeg.org/ffmpeg.git
use bps instead of kbps for bitrate
Originally committed as revision 11337 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
359154bc1b
commit
08ac1e783e
|
@ -669,9 +669,8 @@ static int AC3_encode_init(AVCodecContext *avctx)
|
||||||
s->bitstream_mode = 0; /* complete main audio service */
|
s->bitstream_mode = 0; /* complete main audio service */
|
||||||
|
|
||||||
/* bitrate & frame size */
|
/* bitrate & frame size */
|
||||||
bitrate /= 1000;
|
|
||||||
for(i=0;i<19;i++) {
|
for(i=0;i<19;i++) {
|
||||||
if ((ff_ac3_bitrate_tab[i] >> s->sr_shift) == bitrate)
|
if ((ff_ac3_bitrate_tab[i] >> s->sr_shift)*1000 == bitrate)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == 19)
|
if (i == 19)
|
||||||
|
@ -1240,11 +1239,11 @@ static int AC3_encode_frame(AVCodecContext *avctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust for fractional frame sizes */
|
/* adjust for fractional frame sizes */
|
||||||
while(s->bits_written >= s->bit_rate*1000 && s->samples_written >= s->sample_rate) {
|
while(s->bits_written >= s->bit_rate && s->samples_written >= s->sample_rate) {
|
||||||
s->bits_written -= s->bit_rate*1000;
|
s->bits_written -= s->bit_rate;
|
||||||
s->samples_written -= s->sample_rate;
|
s->samples_written -= s->sample_rate;
|
||||||
}
|
}
|
||||||
s->frame_size = s->frame_size_min + (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate*1000);
|
s->frame_size = s->frame_size_min + (s->bits_written * s->sample_rate < s->samples_written * s->bit_rate);
|
||||||
s->bits_written += s->frame_size * 16;
|
s->bits_written += s->frame_size * 16;
|
||||||
s->samples_written += AC3_FRAME_SIZE;
|
s->samples_written += AC3_FRAME_SIZE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue