static int adts_aac_probe(AVProbeData *p)

{

    int max_frames = 0, first_frames = 0;

    int fsize, frames;

    uint8_t *buf0 = p->buf;

    uint8_t *buf2;

    uint8_t *buf;

    uint8_t *end = buf0 + p->buf_size - 7;



    buf = buf0;



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

        buf2 = buf;



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

            uint32_t header = AV_RB16(buf2);

            if((header&0xFFF6) != 0xFFF0)

                break;

            fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;

            if(fsize < 7)

                break;


            buf2 += fsize;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == buf0)

            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 adts_aac_probe(AVProbeData *p)

{

    int max_frames = 0, first_frames = 0;

    int fsize, frames;

    uint8_t *buf0 = p->buf;

    uint8_t *buf2;

    uint8_t *buf;

    uint8_t *end = buf0 + p->buf_size - 7;



    buf = buf0;



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

        buf2 = buf;



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

            uint32_t header = AV_RB16(buf2);

            if((header&0xFFF6) != 0xFFF0)

                break;

            fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;

            if(fsize < 7)

                break;


            buf2 += fsize;

        }

        max_frames = FFMAX(max_frames, frames);

        if(buf == buf0)

            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 = 0, VAR_2 = 0;

    int VAR_3, VAR_4;

    uint8_t *buf0 = VAR_0->buf;

    uint8_t *buf2;

    uint8_t *buf;

    uint8_t *end = buf0 + VAR_0->buf_size - 7;



    buf = buf0;



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

        buf2 = buf;



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

            uint32_t header = AV_RB16(buf2);

            if((header&0xFFF6) != 0xFFF0)

                break;

            VAR_3 = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;

            if(VAR_3 < 7)

                break;


            buf2 += VAR_3;

        }

        VAR_1 = FFMAX(VAR_1, VAR_4);

        if(buf == buf0)

            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 = 0, VAR_2 = 0; int VAR_3, VAR_4; uint8_t *buf0 = VAR_0->buf; uint8_t *buf2; uint8_t *buf; uint8_t *end = buf0 + VAR_0->buf_size - 7; buf = buf0; for(; buf < end; buf= buf2+1) { buf2 = buf; for(VAR_4 = 0; buf2 < end; VAR_4++) { uint32_t header = AV_RB16(buf2); if((header&0xFFF6) != 0xFFF0)
break; VAR_3 = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF; if(VAR_3 < 7)
break; buf2 += VAR_3; } VAR_1 = FFMAX(VAR_1, VAR_4); if(buf == buf0)
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; }