static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)

{

    ADTSContext *adts = s->priv_data;

    AVIOContext *pb = s->pb;

    uint8_t buf[ADTS_HEADER_SIZE];



    if (!pkt->size)

        return 0;

    if (adts->write_adts) {

        ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size);

        avio_write(pb, buf, ADTS_HEADER_SIZE);

        if (adts->pce_size) {

            avio_write(pb, adts->pce_data, adts->pce_size);

            adts->pce_size = 0;

        }

    }

    avio_write(pb, pkt->data, pkt->size);

    avio_flush(pb);



    return 0;

}

static int adts_write_packet(AVFormatContext *s, AVPacket *pkt)

{

    ADTSContext *adts = s->priv_data;

    AVIOContext *pb = s->pb;

    uint8_t buf[ADTS_HEADER_SIZE];



    if (!pkt->size)

        return 0;

    if (adts->write_adts) {

        ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size);

        avio_write(pb, buf, ADTS_HEADER_SIZE);

        if (adts->pce_size) {

            avio_write(pb, adts->pce_data, adts->pce_size);

            adts->pce_size = 0;

        }

    }

    avio_write(pb, pkt->data, pkt->size);

    avio_flush(pb);



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)

{

    ADTSContext *adts = VAR_0->priv_data;

    AVIOContext *pb = VAR_0->pb;

    uint8_t buf[ADTS_HEADER_SIZE];



    if (!VAR_1->size)

        return 0;

    if (adts->write_adts) {

        ff_adts_write_frame_header(adts, buf, VAR_1->size, adts->pce_size);

        avio_write(pb, buf, ADTS_HEADER_SIZE);

        if (adts->pce_size) {

            avio_write(pb, adts->pce_data, adts->pce_size);

            adts->pce_size = 0;

        }

    }

    avio_write(pb, VAR_1->data, VAR_1->size);

    avio_flush(pb);



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{ ADTSContext *adts = VAR_0->priv_data; AVIOContext *pb = VAR_0->pb; uint8_t buf[ADTS_HEADER_SIZE]; if (!VAR_1->size)
return 0; if (adts->write_adts) { ff_adts_write_frame_header(adts, buf, VAR_1->size, adts->pce_size); avio_write(pb, buf, ADTS_HEADER_SIZE); if (adts->pce_size) { avio_write(pb, adts->pce_data, adts->pce_size); adts->pce_size = 0; } } avio_write(pb, VAR_1->data, VAR_1->size); avio_flush(pb); return 0; }