[FFmpeg-devel] [PATCH] lavfi/testsrc: add "decimals" option to the testsrc filter
Stefano Sabatini
stefasab at gmail.com
Tue Jan 17 12:13:04 CET 2012
On date Sunday 2012-01-15 14:49:01 +0100, Stefano Sabatini encoded:
> On date Thursday 2012-01-12 10:15:59 +0100, Nicolas George encoded:
> > Le tridi 23 nivôse, an CCXX, Stefano Sabatini a écrit :
> > > - second = test->nb_frame * test->time_base.num / test->time_base.den;
> > > + double time = av_q2d(test->time_base) * test->nb_frame;
> > > + second = (int)(time * pow(10, test->nb_decimals));
> >
> > This could probably be done more elegantly with av_rescale_q and a
> > precomputed base, but I guess it does not matter much in a test source.
> >
> > Apart from that, it looks nice to me.
>
> Updated with overflow check (in this case no digits are shown at
> all), please comment.
Pushed this variant.
--
FFmpeg = Frenzy Furious Mournful Programmable Extravagant Guru
More information about the ffmpeg-devel
mailing list