|
@@ -354,14 +354,16 @@ static int mp3_read_probe(AVProbeData *p)
|
|
|
int max_frames, first_frames = 0;
|
|
|
int fsize, frames, sample_rate;
|
|
|
uint32_t header;
|
|
|
- uint8_t *buf, *buf2, *end;
|
|
|
+ uint8_t *buf, *buf0, *buf2, *end;
|
|
|
AVCodecContext avctx;
|
|
|
|
|
|
- if(ff_id3v2_match(p->buf))
|
|
|
- return AVPROBE_SCORE_MAX/2+1; // this must be less than mpeg-ps because some retards put id3v2 tags before mpeg-ps files
|
|
|
+ buf0 = p->buf;
|
|
|
+ if(ff_id3v2_match(buf0)) {
|
|
|
+ buf0 += ff_id3v2_tag_len(buf0);
|
|
|
+ }
|
|
|
|
|
|
max_frames = 0;
|
|
|
- buf = p->buf;
|
|
|
+ buf = buf0;
|
|
|
end = buf + p->buf_size - sizeof(uint32_t);
|
|
|
|
|
|
for(; buf < end; buf= buf2+1) {
|
|
@@ -375,7 +377,7 @@ static int mp3_read_probe(AVProbeData *p)
|
|
|
buf2 += fsize;
|
|
|
}
|
|
|
max_frames = FFMAX(max_frames, frames);
|
|
|
- if(buf == p->buf)
|
|
|
+ if(buf == buf0)
|
|
|
first_frames= frames;
|
|
|
}
|
|
|
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
|