32 #define XING_FLAG_FRAMES 0x01
33 #define XING_FLAG_SIZE 0x02
34 #define XING_FLAG_TOC 0x04
36 #define XING_TOC_COUNT 100
46 int max_frames, first_frames = 0;
47 int fsize, frames, sample_rate;
49 uint8_t *buf, *buf0, *buf2, *end;
54 while(buf0 < end && !*buf0)
60 for(; buf < end; buf= buf2+1) {
63 for(frames = 0; buf2 < end; frames++) {
70 max_frames =
FFMAX(max_frames, frames);
80 unsigned int code = -1;
82 #define VIDEO_ID 0x000001e0
83 #define AUDIO_ID 0x000001c0
87 code = (code << 8) + p->
buf[i];
88 if ((code & 0xffffff00) == 0x100) {
89 if ((code & 0x1f0) ==
VIDEO_ID) pes++;
90 else if((code & 0x1e0) ==
AUDIO_ID) pes++;
95 max_frames = (max_frames + pes - 1) / pes;
99 else if (max_frames >= 1)
return 1;
134 const int64_t
xing_offtbl[2][2] = {{32, 17}, {17,9}};
144 vbrtag_size = c.frame_size;
148 spf = c.lsf ? 576 : 1152;
151 avio_skip(s->
pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
153 is_cbr = v ==
MKBETAG(
'I',
'n',
'f',
'o');
154 if (v ==
MKBETAG(
'X',
'i',
'n',
'g') || is_cbr) {
168 if(v ==
MKBETAG(
'V',
'B',
'R',
'I')) {
187 if (size && frames && !is_cbr)
222 #define MP3_PACKET_SIZE 1024
269 return (ret >= 0) ? 0 : ret;
285 .extensions =
"mp2,mp3,m2a",