static int tee_write_trailer(AVFormatContext *avf)

{

    TeeContext *tee = avf->priv_data;

    AVFormatContext *avf2;

    int ret_all = 0, ret;

    unsigned i;



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

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

        if ((ret = av_write_trailer(avf2)) < 0)

            if (!ret_all)

                ret_all = ret;

        if (!(avf2->oformat->flags & AVFMT_NOFILE))

            ff_format_io_close(avf2, &avf2->pb);

    }

    close_slaves(avf);

    return ret_all;

}

static int tee_write_trailer(AVFormatContext *avf)

{

    TeeContext *tee = avf->priv_data;

    AVFormatContext *avf2;

    int ret_all = 0, ret;

    unsigned i;



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

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

        if ((ret = av_write_trailer(avf2)) < 0)

            if (!ret_all)

                ret_all = ret;

        if (!(avf2->oformat->flags & AVFMT_NOFILE))

            ff_format_io_close(avf2, &avf2->pb);

    }

    close_slaves(avf);

    return ret_all;

}

    AVFormatContext *avf2;         avf2 = tee->slaves[i].avf;         if ((ret = av_write_trailer(avf2)) < 0)         if (!(avf2->oformat->flags & AVFMT_NOFILE))             ff_format_io_close(avf2, &avf2->pb);     close_slaves(avf);
static int FUNC_0(AVFormatContext *VAR_0)

{

    TeeContext *tee = VAR_0->priv_data;

    AVFormatContext *avf2;

    int VAR_1 = 0, VAR_2;

    unsigned VAR_3;



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

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

        if ((VAR_2 = av_write_trailer(avf2)) < 0)

            if (!VAR_1)

                VAR_1 = VAR_2;

        if (!(avf2->oformat->flags & AVFMT_NOFILE))

            ff_format_io_close(avf2, &avf2->pb);

    }

    close_slaves(VAR_0);

    return VAR_1;

}

static int FUNC_0(AVFormatContext *VAR_0)
{ TeeContext *tee = VAR_0->priv_data; AVFormatContext *avf2; int VAR_1 = 0, VAR_2; unsigned VAR_3; for (VAR_3 = 0; VAR_3 < tee->nb_slaves; VAR_3++) { avf2 = tee->slaves[VAR_3].VAR_0; if ((VAR_2 = av_write_trailer(avf2)) < 0)
if (!VAR_1)
VAR_1 = VAR_2; if (!(avf2->oformat->flags & AVFMT_NOFILE))
ff_format_io_close(avf2, &avf2->pb); } close_slaves(VAR_0); return VAR_1; }