|
|
@ -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); |
|
|
|