[vlc-devel] [PATCH 16/24] [codec/libmpeg2] Reduce frame rate to simplest fraction

David Flynn davidf+nntp at woaf.net
Tue Nov 4 15:38:51 CET 2008


On 2008-11-01, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> On Thu, Oct 30, 2008, davidf+nntp at woaf.net wrote:
>>      if( p_sys->p_info->sequence->frame_period > 0 )
>>      {
>> -        p_dec->fmt_out.video.i_frame_rate =
>> -            (uint32_t)( (uint64_t)1001000000 * 27 /
>> -                        p_sys->p_info->sequence->frame_period );
>> -        p_dec->fmt_out.video.i_frame_rate_base = 1001;
>> +        vlc_ureduce( &p_dec->fmt_out.video.i_frame_rate,
>> +                     &p_dec->fmt_out.video.i_frame_rate_base,
>> +                     27 * 1000000,
>> +                     p_sys->p_info->sequence->frame_period,
>> +                     0 );
>  Why is it needed ? No demuxer/codec/packetizer currently ensures that
> the fraction is reduced, so anyone using it should already be carefull
> with it.

Mostly i have an alergic reaction to 1001 pointlessly appearing as a
constant.




More information about the vlc-devel mailing list