37 #define XING_FLAG_FRAMES 0x01
38 #define XING_FLAG_SIZE 0x02
39 #define XING_FLAG_TOC 0x04
41 #define XING_TOC_COUNT 100
59 int max_frames, first_frames = 0;
67 while(buf0 < end && !*buf0)
73 for(; buf <
end; buf= buf2+1) {
78 for(frames = 0; buf2 <
end; frames++) {
85 max_frames =
FFMAX(max_frames, frames);
96 else if(max_frames>=1 && max_frames >= p->
buf_size/10000)
return 1;
105 int fill_index = mp3->
usetoc && duration > 0;
128 #define LAST_BITS(k, n) ((k) & ((1 << (n)) - 1))
129 #define MIDDLE_BITS(k, m, n) LAST_BITS((k) >> (m), ((n) - (m)))
137 int32_t r_gain = INT32_MIN, a_gain = INT32_MIN;
140 static const int64_t
xing_offtbl[2][2] = {{32, 17}, {17,9}};
143 avio_skip(s->
pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]);
207 mp3->start_pad =
v>>12;
208 mp3-> end_pad =
v&4095;
209 st->skip_samples = mp3->start_pad + 528 + 1;
250 if (v ==
MKBETAG(
'V',
'B',
'R',
'I')) {
278 vbrtag_size = c.frame_size;
282 spf = c.lsf ? 576 : 1152;
299 if (mp3->header_filesize && mp3->frames && !mp3->is_cbr)
300 st->codec->bit_rate =
av_rescale(mp3->header_filesize, 8 *
c.sample_rate, mp3->frames * (int64_t)spf);
344 #define MP3_PACKET_SIZE 1024
389 return sd.frame_size;
405 if (filesize <= s->data_offset)
410 timestamp = av_clip64(timestamp, 0, duration);
431 for(i=0; i<4096; i++) {
432 int64_t pos = ie->
pos + i*dir;
475 .extensions =
"mp2,mp3,m2a,mpa",
476 .priv_class = &demuxer_class,