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 |= (srate_idx << 2) << 8;
|
||||||
header |= channels << 6;
|
header |= channels << 6;
|
||||||
|
|
||||||
for (;;) {
|
for (;; bitrate_idx++) {
|
||||||
if (15 == bitrate_idx)
|
if (15 == bitrate_idx)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
mask = (bitrate_idx << 4) << 8;
|
avpriv_mpegaudio_decode_header(&c, header | (bitrate_idx << (4+8)));
|
||||||
header |= mask;
|
|
||||||
avpriv_mpegaudio_decode_header(&c, header);
|
|
||||||
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||||
needed = 4 // header
|
needed = 4 // header
|
||||||
+ xing_offset
|
+ xing_offset
|
||||||
@ -203,9 +201,6 @@ static int mp3_write_xing(AVFormatContext *s)
|
|||||||
|
|
||||||
if (needed <= c.frame_size)
|
if (needed <= c.frame_size)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
header &= ~mask;
|
|
||||||
++bitrate_idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
avio_wb32(s->pb, header);
|
avio_wb32(s->pb, header);
|
||||||
|
Loading…
Reference in New Issue
Block a user