X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmpeg12dec.c;h=186fbd27b6376207095f939e7de88f355c6c630c;hb=49ae8a5e87f99b15514f5ef075d801e9ea8374e9;hp=e49167f89eb3a41f8d2aadf09c74a87724ed618f;hpb=3a033bc5cfaeec391a8258005e025ddf3971d8bc;p=ffmpeg diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index e49167f89eb..186fbd27b63 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1242,7 +1242,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO) { // MPEG-1 aspect - avctx->sample_aspect_ratio = av_d2q(1.0 / ff_mpeg1_aspect[s->aspect_ratio_info], 255); + AVRational aspect_inv = av_d2q(ff_mpeg1_aspect[s->aspect_ratio_info], 255); + avctx->sample_aspect_ratio = (AVRational) { aspect_inv.den, aspect_inv.num }; } else { // MPEG-2 // MPEG-2 aspect if (s->aspect_ratio_info > 1) {