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

Michael Niedermayer michael at niedermayer.cc
Mon Dec 10 00:04:11 EET 2018


On Sun, Dec 09, 2018 at 02:38:55PM +0100, Paul B Mahol wrote:
> Fixes #5155
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavformat/mxfenc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index 3549b4137d..b3c8dc43bd 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -2726,6 +2726,12 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
>          }
>      }
>  
> +    if (st->codecpar->sample_aspect_ratio.num && st->codecpar->sample_aspect_ratio.den) {
> +        av_reduce_q(&sc->aspect_ratio,
> +                    av_mul_q(st->codecpar->sample_aspect_ratio,
> +                             av_make_q(st->codecpar->width, st->codecpar->height)), INT_MAX);
> +    }

AVRational uses int, so av_reduce* should not be needed if INT_MAX is ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181209/23b550b9/attachment.sig>


More information about the ffmpeg-devel mailing list