22 #include "libavutil/avstring.h"
23 #include "libavutil/intreadwrite.h"
24 #include "libavutil/dict.h"
25 #include "libavutil/mathematics.h"
32 #define XING_FLAG_FRAMES 0x01
33 #define XING_FLAG_SIZE 0x02
34 #define XING_FLAG_TOC 0x04
36 #define XING_TOC_COUNT 100
51 int max_frames, first_frames = 0;
59 while(buf0 < end && !*buf0)
65 for(; buf <
end; buf= buf2+1) {
68 for(frames = 0; buf2 <
end; frames++) {
75 max_frames =
FFMAX(max_frames, frames);
86 else if(max_frames>=1)
return 1;
122 const int64_t
xing_offtbl[2][2] = {{32, 17}, {17,9}};
132 vbrtag_size = c.frame_size;
136 spf = c.lsf ? 576 : 1152;
139 avio_skip(s->
pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
141 is_cbr = v ==
MKBETAG(
'I',
'n',
'f',
'o');
142 if (v ==
MKBETAG(
'X',
'i',
'n',
'g') || is_cbr) {
155 if(v ==
MKBETAG(
'L',
'A',
'M',
'E') || v ==
MKBETAG(
'L',
'a',
'v',
'f')) {
159 mp3-> end_pad = v&4095;
168 if(v ==
MKBETAG(
'V',
'B',
'R',
'I')) {
187 if (size && frames && !is_cbr)
230 #define MP3_PACKET_SIZE 1024
275 return sd.frame_size;
291 if (filesize <= s->data_offset)
296 timestamp = av_clip64(timestamp, 0, duration);
315 for(i=0; i<4096; i++) {
316 int64_t pos = ie->
pos + i*dir;
346 .extensions =
"mp2,mp3,m2a",