33 #define XING_FLAG_FRAMES 0x01
34 #define XING_FLAG_SIZE 0x02
35 #define XING_FLAG_TOC 0x04
37 #define XING_TOC_COUNT 100
54 int max_frames, first_frames = 0;
62 while(buf0 < end && !*buf0)
68 for(; buf <
end; buf= buf2+1) {
73 for(frames = 0; buf2 <
end; frames++) {
80 max_frames =
FFMAX(max_frames, frames);
91 else if(max_frames>=1)
return 1;
100 int fill_index = mp3->
usetoc && duration > 0;
129 static const int64_t
xing_offtbl[2][2] = {{32, 17}, {17,9}};
139 vbrtag_size = c.frame_size;
143 spf = c.lsf ? 576 : 1152;
146 avio_skip(s->
pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
148 is_cbr = v ==
MKBETAG(
'I',
'n',
'f',
'o');
149 if (v ==
MKBETAG(
'X',
'i',
'n',
'g') || is_cbr) {
162 if(v ==
MKBETAG(
'L',
'A',
'M',
'E') || v ==
MKBETAG(
'L',
'a',
'v',
'f')) {
166 mp3-> end_pad = v&4095;
179 if(
v ==
MKBETAG(
'V',
'B',
'R',
'I')) {
193 avio_seek(
s->pb, base + vbrtag_size, SEEK_SET);
198 if (
size && frames && !is_cbr)
199 st->codec->bit_rate =
av_rescale(
size, 8 *
c.sample_rate, frames * (int64_t)spf);
201 mp3->is_cbr = is_cbr;
202 mp3->header_filesize =
size;
241 #define MP3_PACKET_SIZE 1024
286 return sd.frame_size;
302 if (filesize <= s->data_offset)
307 timestamp = av_clip64(timestamp, 0, duration);
328 for(i=0; i<4096; i++) {
329 int64_t pos = ie->
pos + i*dir;
372 .extensions =
"mp2,mp3,m2a,mpa",
373 .priv_class = &demuxer_class,