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

Aman Gupta ffmpeg at tmm1.net
Fri Aug 30 18:53:13 EEST 2019


On Thu, Aug 29, 2019 at 10:30 PM Nicolas George <george at nsup.org> wrote:

> 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.
>

The OMX spec requires xFramerate in Q16 format, which is basically
(framerate<<16)

I'm not sure how I would use av_rescale_q to achieve this.


>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list