static void close_slaves(AVFormatContext *avf)

{

    TeeContext *tee = avf->priv_data;

    AVFormatContext *avf2;

    unsigned i, j;



    for (i = 0; i < tee->nb_slaves; i++) {

        avf2 = tee->slaves[i].avf;



        for (j = 0; j < avf2->nb_streams; j++) {

            AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[i].bsfs[j];

            while (bsf) {

                bsf_next = bsf->next;

                av_bitstream_filter_close(bsf);

                bsf = bsf_next;

            }

        }

        av_freep(&tee->slaves[i].stream_map);




        avio_close(avf2->pb);

        avf2->pb = NULL;

        avformat_free_context(avf2);

        tee->slaves[i].avf = NULL;

    }

}
static void close_slaves(AVFormatContext *avf)

{

    TeeContext *tee = avf->priv_data;

    AVFormatContext *avf2;

    unsigned i, j;



    for (i = 0; i < tee->nb_slaves; i++) {

        avf2 = tee->slaves[i].avf;



        for (j = 0; j < avf2->nb_streams; j++) {

            AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[i].bsfs[j];

            while (bsf) {

                bsf_next = bsf->next;

                av_bitstream_filter_close(bsf);

                bsf = bsf_next;

            }

        }

        av_freep(&tee->slaves[i].stream_map);




        avio_close(avf2->pb);

        avf2->pb = NULL;

        avformat_free_context(avf2);

        tee->slaves[i].avf = NULL;

    }

}
static void FUNC_0(AVFormatContext *VAR_0)

{

    TeeContext *tee = VAR_0->priv_data;

    AVFormatContext *avf2;

    unsigned VAR_1, VAR_2;



    for (VAR_1 = 0; VAR_1 < tee->nb_slaves; VAR_1++) {

        avf2 = tee->slaves[VAR_1].VAR_0;



        for (VAR_2 = 0; VAR_2 < avf2->nb_streams; VAR_2++) {

            AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[VAR_1].bsfs[VAR_2];

            while (bsf) {

                bsf_next = bsf->next;

                av_bitstream_filter_close(bsf);

                bsf = bsf_next;

            }

        }

        av_freep(&tee->slaves[VAR_1].stream_map);




        avio_close(avf2->pb);

        avf2->pb = NULL;

        avformat_free_context(avf2);

        tee->slaves[VAR_1].VAR_0 = NULL;

    }

}
static void FUNC_0(AVFormatContext *VAR_0)
{ TeeContext *tee = VAR_0->priv_data; AVFormatContext *avf2; unsigned VAR_1, VAR_2; for (VAR_1 = 0; VAR_1 < tee->nb_slaves; VAR_1++) { avf2 = tee->slaves[VAR_1].VAR_0; for (VAR_2 = 0; VAR_2 < avf2->nb_streams; VAR_2++) { AVBitStreamFilterContext *bsf_next, *bsf = tee->slaves[VAR_1].bsfs[VAR_2]; while (bsf) { bsf_next = bsf->next; av_bitstream_filter_close(bsf); bsf = bsf_next; } } av_freep(&tee->slaves[VAR_1].stream_map); avio_close(avf2->pb); avf2->pb = NULL; avformat_free_context(avf2); tee->slaves[VAR_1].VAR_0 = NULL; } }