[FFmpeg-devel] [PATCH] avformat/utils: improve get duration

平凯 pingkai010 at gmail.com
Thu May 30 18:54:20 CEST 2013


Ok, I've modify the patch as your suggestiones.
I'll provide a sample later. Case the sample file is on the pc that not at
my home now.
2013/5/31 Carl Eugen Hoyos <cehoyos at ag.or.at>

> Ping Kai <pingkai010 <at> gmail.com> writes:
>
> > improve the accuracy of getting
> > duration from bit rate.
>
> Could you provide a sample that gets an
> improved duration by your patch?
>
> > +    int64_t *sample_bit_rate_sum = av_malloc(ic->nb_streams *
> > sizeof(int64_t));
> > +    int *sample_count = av_malloc(ic->nb_streams * sizeof(int));
> >
> > +    if (sample_bit_rate_sum == NULL || sample_count == NULL)
>
> > +        return AVERROR_INVALIDDATA;
>
> AVERROR(ENOMEM)
>
> > +    memset(sample_bit_rate_sum ,0 ,ic->nb_streams * sizeof(int64_t));
> > +    memset(sample_count,0 ,ic->nb_streams * sizeof(int));
>
> If you use av_mallocz, the memset should not be
> necessary.
>
> > -
>
> Do not remove the empty line, same below.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



-- 
――――――――――――――――――――――――
平凯
e-mail:pingkai010 at gmail.com
msn:pingkai010 at hotmail.com
tel:15101537133
qq:306978600


More information about the ffmpeg-devel mailing list