mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 11:22:14 +00:00
mp3enc: simplify mp3_write_xing()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ecf5e70548
commit
1fea432b7a
@ -185,13 +185,11 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
header |= (srate_idx << 2) << 8;
|
||||
header |= channels << 6;
|
||||
|
||||
for (;;) {
|
||||
for (;; bitrate_idx++) {
|
||||
if (15 == bitrate_idx)
|
||||
return -1;
|
||||
|
||||
mask = (bitrate_idx << 4) << 8;
|
||||
header |= mask;
|
||||
avpriv_mpegaudio_decode_header(&c, header);
|
||||
avpriv_mpegaudio_decode_header(&c, header | (bitrate_idx << (4+8)));
|
||||
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||
needed = 4 // header
|
||||
+ xing_offset
|
||||
@ -203,9 +201,6 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
|
||||
if (needed <= c.frame_size)
|
||||
break;
|
||||
|
||||
header &= ~mask;
|
||||
++bitrate_idx;
|
||||
}
|
||||
|
||||
avio_wb32(s->pb, header);
|
||||
|
Loading…
Reference in New Issue
Block a user