[FFmpeg-devel] [PATCH] avcodec/omx: fix xFramerate calculation

Nicolas George george at nsup.org
Fri Aug 30 08:30:29 EEST 2019


Aman Gupta (12019-08-29):
> > > -        in_port_params.format.video.xFramerate = (1 << 16) *
> > avctx->framerate.num / avctx->framerate.den;
> > > +        in_port_params.format.video.xFramerate = (int64_t)(1 << 16) *
> > avctx->framerate.num / avctx->framerate.den;
> >
> > change 1 > 1LL is more simple to solve the overflow.
> 
> Great, thank you for the tip! Updated my local patch accordingly.

This remark looks weird: using long long directly is almost never
correct code.

And in this particular case, av_rescale_q() seems the correct choice.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190830/5eb96438/attachment.sig>


More information about the ffmpeg-devel mailing list