matroska_read_close (AVFormatContext *s)

{

    MatroskaDemuxContext *matroska = s->priv_data;

    int n = 0;



    if (matroska->writing_app)

        av_free(matroska->writing_app);

    if (matroska->muxing_app)

        av_free(matroska->muxing_app);

    if (matroska->index)

        av_free(matroska->index);



    if (matroska->packets != NULL) {

        for (n = 0; n < matroska->num_packets; n++) {

            av_free_packet(matroska->packets[n]);

            av_free(matroska->packets[n]);

        }

        av_free(matroska->packets);

    }



    for (n = 0; n < matroska->num_tracks; n++) {

        MatroskaTrack *track = matroska->tracks[n];

        if (track->codec_id)

            av_free(track->codec_id);

        if (track->codec_name)

            av_free(track->codec_name);

        if (track->codec_priv)

            av_free(track->codec_priv);

        if (track->name)

            av_free(track->name);

        if (track->language)

            av_free(track->language);



        av_free(track);

    }



    memset(matroska, 0, sizeof(MatroskaDemuxContext));



    return 0;

}

matroska_read_close (AVFormatContext *s)

{

    MatroskaDemuxContext *matroska = s->priv_data;

    int n = 0;



    if (matroska->writing_app)

        av_free(matroska->writing_app);

    if (matroska->muxing_app)

        av_free(matroska->muxing_app);

    if (matroska->index)

        av_free(matroska->index);



    if (matroska->packets != NULL) {

        for (n = 0; n < matroska->num_packets; n++) {

            av_free_packet(matroska->packets[n]);

            av_free(matroska->packets[n]);

        }

        av_free(matroska->packets);

    }



    for (n = 0; n < matroska->num_tracks; n++) {

        MatroskaTrack *track = matroska->tracks[n];

        if (track->codec_id)

            av_free(track->codec_id);

        if (track->codec_name)

            av_free(track->codec_name);

        if (track->codec_priv)

            av_free(track->codec_priv);

        if (track->name)

            av_free(track->name);

        if (track->language)

            av_free(track->language);



        av_free(track);

    }



    memset(matroska, 0, sizeof(MatroskaDemuxContext));



    return 0;

}

FUNC_0 (AVFormatContext *VAR_0)

{

    MatroskaDemuxContext *matroska = VAR_0->priv_data;

    int VAR_1 = 0;



    if (matroska->writing_app)

        av_free(matroska->writing_app);

    if (matroska->muxing_app)

        av_free(matroska->muxing_app);

    if (matroska->index)

        av_free(matroska->index);



    if (matroska->packets != NULL) {

        for (VAR_1 = 0; VAR_1 < matroska->num_packets; VAR_1++) {

            av_free_packet(matroska->packets[VAR_1]);

            av_free(matroska->packets[VAR_1]);

        }

        av_free(matroska->packets);

    }



    for (VAR_1 = 0; VAR_1 < matroska->num_tracks; VAR_1++) {

        MatroskaTrack *track = matroska->tracks[VAR_1];

        if (track->codec_id)

            av_free(track->codec_id);

        if (track->codec_name)

            av_free(track->codec_name);

        if (track->codec_priv)

            av_free(track->codec_priv);

        if (track->name)

            av_free(track->name);

        if (track->language)

            av_free(track->language);



        av_free(track);

    }



    memset(matroska, 0, sizeof(MatroskaDemuxContext));



    return 0;

}

FUNC_0 (AVFormatContext *VAR_0)
{ MatroskaDemuxContext *matroska = VAR_0->priv_data; int VAR_1 = 0; if (matroska->writing_app)
av_free(matroska->writing_app); if (matroska->muxing_app)
av_free(matroska->muxing_app); if (matroska->index)
av_free(matroska->index); if (matroska->packets != NULL) { for (VAR_1 = 0; VAR_1 < matroska->num_packets; VAR_1++) { av_free_packet(matroska->packets[VAR_1]); av_free(matroska->packets[VAR_1]); } av_free(matroska->packets); } for (VAR_1 = 0; VAR_1 < matroska->num_tracks; VAR_1++) { MatroskaTrack *track = matroska->tracks[VAR_1]; if (track->codec_id)
av_free(track->codec_id); if (track->codec_name)
av_free(track->codec_name); if (track->codec_priv)
av_free(track->codec_priv); if (track->name)
av_free(track->name); if (track->language)
av_free(track->language); av_free(track); } memset(matroska, 0, sizeof(MatroskaDemuxContext)); return 0; }