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;

    AVCodecContext avctx;



    if(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



    max_frames = 0;

    buf = p->buf;

    end = buf + p->buf_size - sizeof(uint32_t);



    for(; buf < end; buf= buf2+1) {

        buf2 = buf;



        for(frames = 0; buf2 < end; frames++) {

            header = AV_RB32(buf2);

            fsize = ff_mpa_decode_header(&avctx, header, &sample_rate);

            if(fsize < 0)

                break;

            buf2 += fsize;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames= frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;

    else if(max_frames>500)return AVPROBE_SCORE_MAX/2;

    else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;

    else if(max_frames>=1) return 1;

    else                   return 0;

}

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;

    AVCodecContext avctx;



    if(id3v2_match(p->buf))

        return AVPROBE_SCORE_MAX/2+1; 



    max_frames = 0;

    buf = p->buf;

    end = buf + p->buf_size - sizeof(uint32_t);



    for(; buf < end; buf= buf2+1) {

        buf2 = buf;



        for(frames = 0; buf2 < end; frames++) {

            header = AV_RB32(buf2);

            fsize = ff_mpa_decode_header(&avctx, header, &sample_rate);

            if(fsize < 0)

                break;

            buf2 += fsize;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames= frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;

    else if(max_frames>500)return AVPROBE_SCORE_MAX/2;

    else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;

    else if(max_frames>=1) return 1;

    else                   return 0;

}

static int FUNC_0(AVProbeData *VAR_0)

{

    int VAR_1, VAR_2 = 0;

    int VAR_3, VAR_4, VAR_5;

    uint32_t header;

    uint8_t *buf, *buf2, *end;

    AVCodecContext avctx;



    if(id3v2_match(VAR_0->buf))

        return AVPROBE_SCORE_MAX/2+1; 



    VAR_1 = 0;

    buf = VAR_0->buf;

    end = buf + VAR_0->buf_size - sizeof(uint32_t);



    for(; buf < end; buf= buf2+1) {

        buf2 = buf;



        for(VAR_4 = 0; buf2 < end; VAR_4++) {

            header = AV_RB32(buf2);

            VAR_3 = ff_mpa_decode_header(&avctx, header, &VAR_5);

            if(VAR_3 < 0)

                break;

            buf2 += VAR_3;

        }

        VAR_1 = FFMAX(VAR_1, VAR_4);

        if(buf == VAR_0->buf)

            VAR_2= VAR_4;

    }

    if   (VAR_2>=3) return AVPROBE_SCORE_MAX/2+1;

    else if(VAR_1>500)return AVPROBE_SCORE_MAX/2;

    else if(VAR_1>=3) return AVPROBE_SCORE_MAX/4;

    else if(VAR_1>=1) return 1;

    else                   return 0;

}

static int FUNC_0(AVProbeData *VAR_0)
{ int VAR_1, VAR_2 = 0; int VAR_3, VAR_4, VAR_5; uint32_t header; uint8_t *buf, *buf2, *end; AVCodecContext avctx; if(id3v2_match(VAR_0->buf))
return AVPROBE_SCORE_MAX/2+1; VAR_1 = 0; buf = VAR_0->buf; end = buf + VAR_0->buf_size - sizeof(uint32_t); for(; buf < end; buf= buf2+1) { buf2 = buf; for(VAR_4 = 0; buf2 < end; VAR_4++) { header = AV_RB32(buf2); VAR_3 = ff_mpa_decode_header(&avctx, header, &VAR_5); if(VAR_3 < 0)
break; buf2 += VAR_3; } VAR_1 = FFMAX(VAR_1, VAR_4); if(buf == VAR_0->buf)
VAR_2= VAR_4; } if   (VAR_2>=3) return AVPROBE_SCORE_MAX/2+1; else if(VAR_1>500)return AVPROBE_SCORE_MAX/2; else if(VAR_1>=3) return AVPROBE_SCORE_MAX/4; else if(VAR_1>=1) return 1; else                   return 0; }