static int ac3_probe(AVProbeData *p)

{

    int max_frames, first_frames = 0, frames;

    uint8_t *buf, *buf2, *end;

    AC3HeaderInfo hdr;



    if(p->buf_size < 7)

        return 0;



    max_frames = 0;

    buf = p->buf;

    end = buf + p->buf_size;



    for(; buf < end; buf++) {

        buf2 = buf;



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

            if(ff_ac3_parse_header(buf2, &hdr) < 0)

                break;

            buf2 += hdr.frame_size;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames = frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;

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

    else if(max_frames>=1) return 1;

    else                   return 0;

}

static int ac3_probe(AVProbeData *p)

{

    int max_frames, first_frames = 0, frames;

    uint8_t *buf, *buf2, *end;

    AC3HeaderInfo hdr;



    if(p->buf_size < 7)

        return 0;



    max_frames = 0;

    buf = p->buf;

    end = buf + p->buf_size;



    for(; buf < end; buf++) {

        buf2 = buf;



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

            if(ff_ac3_parse_header(buf2, &hdr) < 0)

                break;

            buf2 += hdr.frame_size;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == p->buf)

            first_frames = frames;

    }

    if   (first_frames>=3) return AVPROBE_SCORE_MAX * 3 / 4;

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

    else if(max_frames>=1) return 1;

    else                   return 0;

}

static int FUNC_0(AVProbeData *VAR_0)

{

    int VAR_1, VAR_2 = 0, VAR_3;

    uint8_t *buf, *buf2, *end;

    AC3HeaderInfo hdr;



    if(VAR_0->buf_size < 7)

        return 0;



    VAR_1 = 0;

    buf = VAR_0->buf;

    end = buf + VAR_0->buf_size;



    for(; buf < end; buf++) {

        buf2 = buf;



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

            if(ff_ac3_parse_header(buf2, &hdr) < 0)

                break;

            buf2 += hdr.frame_size;

        }

        VAR_1 = FFMAX(VAR_1, VAR_3);

        if(buf == VAR_0->buf)

            VAR_2 = VAR_3;

    }

    if   (VAR_2>=3) return AVPROBE_SCORE_MAX * 3 / 4;

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

    else if(VAR_1>=1) return 1;

    else                   return 0;

}

static int FUNC_0(AVProbeData *VAR_0)
{ int VAR_1, VAR_2 = 0, VAR_3; uint8_t *buf, *buf2, *end; AC3HeaderInfo hdr; if(VAR_0->buf_size < 7)
return 0; VAR_1 = 0; buf = VAR_0->buf; end = buf + VAR_0->buf_size; for(; buf < end; buf++) { buf2 = buf; for(VAR_3 = 0; buf2 < end; VAR_3++) { if(ff_ac3_parse_header(buf2, &hdr) < 0)
break; buf2 += hdr.frame_size; } VAR_1 = FFMAX(VAR_1, VAR_3); if(buf == VAR_0->buf)
VAR_2 = VAR_3; } if   (VAR_2>=3) return AVPROBE_SCORE_MAX * 3 / 4; else if(VAR_1>=3) return AVPROBE_SCORE_MAX / 2; else if(VAR_1>=1) return 1; else                   return 0; }