static int matroska_deliver_packet(MatroskaDemuxContext *matroska,

                                   AVPacket *pkt)

{

    if (matroska->num_packets > 0) {

        memcpy(pkt, matroska->packets[0], sizeof(AVPacket));

        av_free(matroska->packets[0]);

        if (matroska->num_packets > 1) {

            memmove(&matroska->packets[0], &matroska->packets[1],

                    (matroska->num_packets - 1) * sizeof(AVPacket *));

            matroska->packets =

                av_realloc(matroska->packets, (matroska->num_packets - 1) *

                           sizeof(AVPacket *));

        } else {

            av_freep(&matroska->packets);

        }

        matroska->num_packets--;

        return 0;

    }



    return -1;

}

static int matroska_deliver_packet(MatroskaDemuxContext *matroska,

                                   AVPacket *pkt)

{

    if (matroska->num_packets > 0) {

        memcpy(pkt, matroska->packets[0], sizeof(AVPacket));

        av_free(matroska->packets[0]);

        if (matroska->num_packets > 1) {

            memmove(&matroska->packets[0], &matroska->packets[1],

                    (matroska->num_packets - 1) * sizeof(AVPacket *));

            matroska->packets =

                av_realloc(matroska->packets, (matroska->num_packets - 1) *

                           sizeof(AVPacket *));

        } else {

            av_freep(&matroska->packets);

        }

        matroska->num_packets--;

        return 0;

    }



    return -1;

}

            matroska->packets =                 av_realloc(matroska->packets, (matroska->num_packets - 1) *                            sizeof(AVPacket *));
static int FUNC_0(MatroskaDemuxContext *VAR_0,

                                   AVPacket *VAR_1)

{

    if (VAR_0->num_packets > 0) {

        memcpy(VAR_1, VAR_0->packets[0], sizeof(AVPacket));

        av_free(VAR_0->packets[0]);

        if (VAR_0->num_packets > 1) {

            memmove(&VAR_0->packets[0], &VAR_0->packets[1],

                    (VAR_0->num_packets - 1) * sizeof(AVPacket *));

            VAR_0->packets =

                av_realloc(VAR_0->packets, (VAR_0->num_packets - 1) *

                           sizeof(AVPacket *));

        } else {

            av_freep(&VAR_0->packets);

        }

        VAR_0->num_packets--;

        return 0;

    }



    return -1;

}

static int FUNC_0(MatroskaDemuxContext *VAR_0,
AVPacket *VAR_1)
{ if (VAR_0->num_packets > 0) { memcpy(VAR_1, VAR_0->packets[0], sizeof(AVPacket)); av_free(VAR_0->packets[0]); if (VAR_0->num_packets > 1) { memmove(&VAR_0->packets[0], &VAR_0->packets[1],
(VAR_0->num_packets - 1) * sizeof(AVPacket *)); VAR_0->packets =
av_realloc(VAR_0->packets, (VAR_0->num_packets - 1) *
sizeof(AVPacket *)); } else { av_freep(&VAR_0->packets); } VAR_0->num_packets--; return 0; } return -1; }