static void new_pes_packet(PESContext *pes, AVPacket *pkt)

{

    av_init_packet(pkt);



    pkt->destruct = av_destruct_packet;

    pkt->data = pes->buffer;

    pkt->size = pes->data_index;

    memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);



    // Separate out the AC3 substream from an HDMV combined TrueHD/AC3 PID

    if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)

        pkt->stream_index = pes->sub_st->index;

    else

        pkt->stream_index = pes->st->index;

    pkt->pts = pes->pts;

    pkt->dts = pes->dts;

    /* store position of first TS packet of this PES packet */

    pkt->pos = pes->ts_packet_pos;




    /* reset pts values */

    pes->pts = AV_NOPTS_VALUE;

    pes->dts = AV_NOPTS_VALUE;

    pes->buffer = NULL;

    pes->data_index = 0;


}
static void new_pes_packet(PESContext *pes, AVPacket *pkt)

{

    av_init_packet(pkt);



    pkt->destruct = av_destruct_packet;

    pkt->data = pes->buffer;

    pkt->size = pes->data_index;

    memset(pkt->data+pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);



    

    if (pes->sub_st && pes->stream_type == 0x83 && pes->extended_stream_id == 0x76)

        pkt->stream_index = pes->sub_st->index;

    else

        pkt->stream_index = pes->st->index;

    pkt->pts = pes->pts;

    pkt->dts = pes->dts;

    

    pkt->pos = pes->ts_packet_pos;




    

    pes->pts = AV_NOPTS_VALUE;

    pes->dts = AV_NOPTS_VALUE;

    pes->buffer = NULL;

    pes->data_index = 0;


}
static void FUNC_0(PESContext *VAR_0, AVPacket *VAR_1)

{

    av_init_packet(VAR_1);



    VAR_1->destruct = av_destruct_packet;

    VAR_1->data = VAR_0->buffer;

    VAR_1->size = VAR_0->data_index;

    memset(VAR_1->data+VAR_1->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);



    

    if (VAR_0->sub_st && VAR_0->stream_type == 0x83 && VAR_0->extended_stream_id == 0x76)

        VAR_1->stream_index = VAR_0->sub_st->index;

    else

        VAR_1->stream_index = VAR_0->st->index;

    VAR_1->pts = VAR_0->pts;

    VAR_1->dts = VAR_0->dts;

    

    VAR_1->pos = VAR_0->ts_packet_pos;




    

    VAR_0->pts = AV_NOPTS_VALUE;

    VAR_0->dts = AV_NOPTS_VALUE;

    VAR_0->buffer = NULL;

    VAR_0->data_index = 0;


}
static void FUNC_0(PESContext *VAR_0, AVPacket *VAR_1)
{ av_init_packet(VAR_1); VAR_1->destruct = av_destruct_packet; VAR_1->data = VAR_0->buffer; VAR_1->size = VAR_0->data_index; memset(VAR_1->data+VAR_1->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); if (VAR_0->sub_st && VAR_0->stream_type == 0x83 && VAR_0->extended_stream_id == 0x76)
VAR_1->stream_index = VAR_0->sub_st->index; else
VAR_1->stream_index = VAR_0->st->index; VAR_1->pts = VAR_0->pts; VAR_1->dts = VAR_0->dts; VAR_1->pos = VAR_0->ts_packet_pos; VAR_0->pts = AV_NOPTS_VALUE; VAR_0->dts = AV_NOPTS_VALUE; VAR_0->buffer = NULL; VAR_0->data_index = 0; }