[FFmpeg-devel] [PATCH] lavfi/testsrc: add "decimals" option to the testsrc filter
stefasab at gmail.com
Sun Jan 15 14:49:01 CET 2012
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.
FFmpeg = Fundamentalist and Funny Mega Problematic Empowered Goblin
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3261 bytes
Desc: not available
More information about the ffmpeg-devel