int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,

                        const uint8_t *buf, int len)

{

    int len1;



    len1 = len;

    ts->pkt = pkt;

    ts->stop_parse = 0;

    for(;;) {

        if (ts->stop_parse>0)

            break;

        if (len < TS_PACKET_SIZE)

            return -1;

        if (buf[0] != 0x47) {

            buf++;

            len--;

        } else {

            handle_packet(ts, buf);

            buf += TS_PACKET_SIZE;

            len -= TS_PACKET_SIZE;

        }

    }

    return len1 - len;

}

int ff_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt,

                        const uint8_t *buf, int len)

{

    int len1;



    len1 = len;

    ts->pkt = pkt;

    ts->stop_parse = 0;

    for(;;) {

        if (ts->stop_parse>0)

            break;

        if (len < TS_PACKET_SIZE)

            return -1;

        if (buf[0] != 0x47) {

            buf++;

            len--;

        } else {

            handle_packet(ts, buf);

            buf += TS_PACKET_SIZE;

            len -= TS_PACKET_SIZE;

        }

    }

    return len1 - len;

}

    ts->stop_parse = 0;         if (ts->stop_parse>0)             break;
int FUNC_0(MpegTSContext *VAR_0, AVPacket *VAR_1,

                        const uint8_t *VAR_2, int VAR_3)

{

    int VAR_4;



    VAR_4 = VAR_3;

    VAR_0->VAR_1 = VAR_1;

    VAR_0->stop_parse = 0;

    for(;;) {

        if (VAR_0->stop_parse>0)

            break;

        if (VAR_3 < TS_PACKET_SIZE)

            return -1;

        if (VAR_2[0] != 0x47) {

            VAR_2++;

            VAR_3--;

        } else {

            handle_packet(VAR_0, VAR_2);

            VAR_2 += TS_PACKET_SIZE;

            VAR_3 -= TS_PACKET_SIZE;

        }

    }

    return VAR_4 - VAR_3;

}

int FUNC_0(MpegTSContext *VAR_0, AVPacket *VAR_1,
const uint8_t *VAR_2, int VAR_3)
{ int VAR_4; VAR_4 = VAR_3; VAR_0->VAR_1 = VAR_1; VAR_0->stop_parse = 0; for(;;) { if (VAR_0->stop_parse>0)
break; if (VAR_3 < TS_PACKET_SIZE)
return -1; if (VAR_2[0] != 0x47) { VAR_2++; VAR_3--; } else { handle_packet(VAR_0, VAR_2); VAR_2 += TS_PACKET_SIZE; VAR_3 -= TS_PACKET_SIZE; } } return VAR_4 - VAR_3; }