static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)

{

    int64_t filesize, duration;

    int bit_rate, i;

    AVStream *st;



    /* if bit_rate is already set, we believe it */

    if (ic->bit_rate == 0) {

        bit_rate = 0;

        for(i=0;i<ic->nb_streams;i++) {

            st = ic->streams[i];

            bit_rate += st->codec->bit_rate;

        }

        ic->bit_rate = bit_rate;

    }



    /* if duration is already set, we believe it */

    if (ic->duration == AV_NOPTS_VALUE &&

        ic->bit_rate != 0 &&

        ic->file_size != 0)  {

        filesize = ic->file_size;

        if (filesize > 0) {

            for(i = 0; i < ic->nb_streams; i++) {

                st = ic->streams[i];

                duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);

                if (st->duration == AV_NOPTS_VALUE)

                    st->duration = duration;

            }

        }

    }

}

static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)

{

    int64_t filesize, duration;

    int bit_rate, i;

    AVStream *st;



    

    if (ic->bit_rate == 0) {

        bit_rate = 0;

        for(i=0;i<ic->nb_streams;i++) {

            st = ic->streams[i];

            bit_rate += st->codec->bit_rate;

        }

        ic->bit_rate = bit_rate;

    }



    

    if (ic->duration == AV_NOPTS_VALUE &&

        ic->bit_rate != 0 &&

        ic->file_size != 0)  {

        filesize = ic->file_size;

        if (filesize > 0) {

            for(i = 0; i < ic->nb_streams; i++) {

                st = ic->streams[i];

                duration= av_rescale(8*filesize, st->time_base.den, ic->bit_rate*(int64_t)st->time_base.num);

                if (st->duration == AV_NOPTS_VALUE)

                    st->duration = duration;

            }

        }

    }

}

    if (ic->bit_rate == 0) {
static void FUNC_0(AVFormatContext *VAR_0)

{

    int64_t filesize, duration;

    int VAR_1, VAR_2;

    AVStream *st;



    

    if (VAR_0->VAR_1 == 0) {

        VAR_1 = 0;

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

            st = VAR_0->streams[VAR_2];

            VAR_1 += st->codec->VAR_1;

        }

        VAR_0->VAR_1 = VAR_1;

    }



    

    if (VAR_0->duration == AV_NOPTS_VALUE &&

        VAR_0->VAR_1 != 0 &&

        VAR_0->file_size != 0)  {

        filesize = VAR_0->file_size;

        if (filesize > 0) {

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

                st = VAR_0->streams[VAR_2];

                duration= av_rescale(8*filesize, st->time_base.den, VAR_0->VAR_1*(int64_t)st->time_base.num);

                if (st->duration == AV_NOPTS_VALUE)

                    st->duration = duration;

            }

        }

    }

}

static void FUNC_0(AVFormatContext *VAR_0)
{ int64_t filesize, duration; int VAR_1, VAR_2; AVStream *st; if (VAR_0->VAR_1 == 0) { VAR_1 = 0; for(VAR_2=0;VAR_2<VAR_0->nb_streams;VAR_2++) { st = VAR_0->streams[VAR_2]; VAR_1 += st->codec->VAR_1; } VAR_0->VAR_1 = VAR_1; } if (VAR_0->duration == AV_NOPTS_VALUE &&
VAR_0->VAR_1 != 0 &&
VAR_0->file_size != 0)  { filesize = VAR_0->file_size; if (filesize > 0) { for(VAR_2 = 0; VAR_2 < VAR_0->nb_streams; VAR_2++) { st = VAR_0->streams[VAR_2]; duration= av_rescale(8*filesize, st->time_base.den, VAR_0->VAR_1*(int64_t)st->time_base.num); if (st->duration == AV_NOPTS_VALUE)
st->duration = duration; } } } }