[Ffmpeg-devel] Re: changes to asf demuxer

Uoti Urpala uoti.urpala
Mon Mar 19 19:04:55 CET 2007

On Mon, 2007-03-19 at 13:37 -0400, Jon Elwood wrote:
> av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
> get_std_framerate(j), 12*1001, INT_MAX);

> So, r_frame_rate.num and r_frame_rate.den must be set somewhere in here.
> The problem is I looked in av_reduce and I have no idea what this function
> does.  What is the purpose of this function (I found it in fational.c, but I
> didn't understand its purpose)?  What's interesting is I have at least 20

That call reduces the fraction get_std_framerate(j) / (12*1001) to
lowest terms, replacing it with the closest possible approximation with
the terms below INT_MAX if the original int64_t values were bigger
(seems unlikely in this case though), and places the resulting numerator
and denominator in st->r_frame_rate.num and st->r_frame_rate.den.

So basically it writes the fps value get_std_framerate(j)/(12*1001) to
the st->r_frame_rate fields.

More information about the ffmpeg-devel mailing list