static int mpegts_probe(AVProbeData *p)

{

    const int size = p->buf_size;

    int score, fec_score, dvhs_score;

    int check_count = size / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10



    if (check_count < CHECK_COUNT)

        return AVERROR_INVALIDDATA;



    score = analyze(p->buf, TS_PACKET_SIZE * check_count,

                    TS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    dvhs_score = analyze(p->buf, TS_DVHS_PACKET_SIZE * check_count,

                         TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE * check_count,

                        TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",

            score, dvhs_score, fec_score);



    /* we need a clear definition for the returned score otherwise

     * things will become messy sooner or later */

    if (score > fec_score && score > dvhs_score && score > 6)

        return AVPROBE_SCORE_MAX + score - CHECK_COUNT;

    else if (dvhs_score > score && dvhs_score > fec_score && dvhs_score > 6)

        return AVPROBE_SCORE_MAX + dvhs_score - CHECK_COUNT;

    else if (fec_score > 6)

        return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT;

    else

        return AVERROR_INVALIDDATA;

}

static int mpegts_probe(AVProbeData *p)

{

    const int size = p->buf_size;

    int score, fec_score, dvhs_score;

    int check_count = size / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10



    if (check_count < CHECK_COUNT)

        return AVERROR_INVALIDDATA;



    score = analyze(p->buf, TS_PACKET_SIZE * check_count,

                    TS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    dvhs_score = analyze(p->buf, TS_DVHS_PACKET_SIZE * check_count,

                         TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE * check_count,

                        TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;

    av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n",

            score, dvhs_score, fec_score);



    



    if (score > fec_score && score > dvhs_score && score > 6)

        return AVPROBE_SCORE_MAX + score - CHECK_COUNT;

    else if (dvhs_score > score && dvhs_score > fec_score && dvhs_score > 6)

        return AVPROBE_SCORE_MAX + dvhs_score - CHECK_COUNT;

    else if (fec_score > 6)

        return AVPROBE_SCORE_MAX + fec_score - CHECK_COUNT;

    else

        return AVERROR_INVALIDDATA;

}

                    TS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;                          TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;                         TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / check_count;
static int FUNC_0(AVProbeData *VAR_0)

{

    const int VAR_1 = VAR_0->buf_size;

    int VAR_2, VAR_3, VAR_4;

    int VAR_5 = VAR_1 / TS_FEC_PACKET_SIZE;

#define CHECK_COUNT 10



    if (VAR_5 < CHECK_COUNT)

        return AVERROR_INVALIDDATA;



    VAR_2 = analyze(VAR_0->buf, TS_PACKET_SIZE * VAR_5,

                    TS_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5;

    VAR_4 = analyze(VAR_0->buf, TS_DVHS_PACKET_SIZE * VAR_5,

                         TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5;

    VAR_3 = analyze(VAR_0->buf, TS_FEC_PACKET_SIZE * VAR_5,

                        TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5;

    av_dlog(NULL, "VAR_2: %d, VAR_4: %d, VAR_3: %d \n",

            VAR_2, VAR_4, VAR_3);



    



    if (VAR_2 > VAR_3 && VAR_2 > VAR_4 && VAR_2 > 6)

        return AVPROBE_SCORE_MAX + VAR_2 - CHECK_COUNT;

    else if (VAR_4 > VAR_2 && VAR_4 > VAR_3 && VAR_4 > 6)

        return AVPROBE_SCORE_MAX + VAR_4 - CHECK_COUNT;

    else if (VAR_3 > 6)

        return AVPROBE_SCORE_MAX + VAR_3 - CHECK_COUNT;

    else

        return AVERROR_INVALIDDATA;

}

static int FUNC_0(AVProbeData *VAR_0)
{ const int VAR_1 = VAR_0->buf_size; int VAR_2, VAR_3, VAR_4; int VAR_5 = VAR_1 / TS_FEC_PACKET_SIZE; #define CHECK_COUNT 10
if (VAR_5 < CHECK_COUNT)
return AVERROR_INVALIDDATA; VAR_2 = analyze(VAR_0->buf, TS_PACKET_SIZE * VAR_5,
TS_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5; VAR_4 = analyze(VAR_0->buf, TS_DVHS_PACKET_SIZE * VAR_5,
TS_DVHS_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5; VAR_3 = analyze(VAR_0->buf, TS_FEC_PACKET_SIZE * VAR_5,
TS_FEC_PACKET_SIZE, NULL) * CHECK_COUNT / VAR_5; av_dlog(NULL, "VAR_2: %d, VAR_4: %d, VAR_3: %d \n",
VAR_2, VAR_4, VAR_3); if (VAR_2 > VAR_3 && VAR_2 > VAR_4 && VAR_2 > 6)
return AVPROBE_SCORE_MAX + VAR_2 - CHECK_COUNT; else if (VAR_4 > VAR_2 && VAR_4 > VAR_3 && VAR_4 > 6)
return AVPROBE_SCORE_MAX + VAR_4 - CHECK_COUNT; else if (VAR_3 > 6)
return AVPROBE_SCORE_MAX + VAR_3 - CHECK_COUNT; else
return AVERROR_INVALIDDATA; }