static int get_packet_size(const uint8_t *buf, int size)

{

    int score, fec_score, dvhs_score;



    if (size < (TS_FEC_PACKET_SIZE * 5 + 1))

        return AVERROR_INVALIDDATA;



    score      = analyze(buf, size, TS_PACKET_SIZE, NULL);

    dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);

    fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);

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

            score, dvhs_score, fec_score);



    if (score > fec_score && score > dvhs_score)

        return TS_PACKET_SIZE;

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

        return TS_DVHS_PACKET_SIZE;

    else if (score < fec_score && dvhs_score < fec_score)

        return TS_FEC_PACKET_SIZE;

    else

        return AVERROR_INVALIDDATA;

}

static int get_packet_size(const uint8_t *buf, int size)

{

    int score, fec_score, dvhs_score;



    if (size < (TS_FEC_PACKET_SIZE * 5 + 1))

        return AVERROR_INVALIDDATA;



    score      = analyze(buf, size, TS_PACKET_SIZE, NULL);

    dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);

    fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);

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

            score, dvhs_score, fec_score);



    if (score > fec_score && score > dvhs_score)

        return TS_PACKET_SIZE;

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

        return TS_DVHS_PACKET_SIZE;

    else if (score < fec_score && dvhs_score < fec_score)

        return TS_FEC_PACKET_SIZE;

    else

        return AVERROR_INVALIDDATA;

}

    score      = analyze(buf, size, TS_PACKET_SIZE, NULL);     dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL);     fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE, NULL);
static int FUNC_0(const uint8_t *VAR_0, int VAR_1)

{

    int VAR_2, VAR_3, VAR_4;



    if (VAR_1 < (TS_FEC_PACKET_SIZE * 5 + 1))

        return AVERROR_INVALIDDATA;



    VAR_2      = analyze(VAR_0, VAR_1, TS_PACKET_SIZE, NULL);

    VAR_4 = analyze(VAR_0, VAR_1, TS_DVHS_PACKET_SIZE, NULL);

    VAR_3  = analyze(VAR_0, VAR_1, TS_FEC_PACKET_SIZE, NULL);

    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)

        return TS_PACKET_SIZE;

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

        return TS_DVHS_PACKET_SIZE;

    else if (VAR_2 < VAR_3 && VAR_4 < VAR_3)

        return TS_FEC_PACKET_SIZE;

    else

        return AVERROR_INVALIDDATA;

}

static int FUNC_0(const uint8_t *VAR_0, int VAR_1)
{ int VAR_2, VAR_3, VAR_4; if (VAR_1 < (TS_FEC_PACKET_SIZE * 5 + 1))
return AVERROR_INVALIDDATA; VAR_2      = analyze(VAR_0, VAR_1, TS_PACKET_SIZE, NULL); VAR_4 = analyze(VAR_0, VAR_1, TS_DVHS_PACKET_SIZE, NULL); VAR_3  = analyze(VAR_0, VAR_1, TS_FEC_PACKET_SIZE, NULL); 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)
return TS_PACKET_SIZE; else if (VAR_4 > VAR_2 && VAR_4 > VAR_3)
return TS_DVHS_PACKET_SIZE; else if (VAR_2 < VAR_3 && VAR_4 < VAR_3)
return TS_FEC_PACKET_SIZE; else
return AVERROR_INVALIDDATA; }