[FFmpeg-devel] [PATCH] avformat/mxfenc: calculate and store DAR from user SAR

Nicolas George george at nsup.org
Sun Dec 9 14:57:46 EET 2018


Paul B Mahol (2018-12-09):
> >> +    if (st->codecpar->sample_aspect_ratio.num &&
> >> st->codecpar->sample_aspect_ratio.den) {
> >> +        av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
> >> +                  st->codecpar->sample_aspect_ratio.num *
> >> st->codecpar->width,
> >> +                  st->codecpar->sample_aspect_ratio.den *
> >> st->codecpar->height, INT_MAX);

> There is no av_reduce_q.

But there are av_mul_q() and av_div_q(), that would make these
computations much more readable, and are protected from overflow.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181209/404bc7e8/attachment.sig>


More information about the ffmpeg-devel mailing list