diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2020-08-21 16:28:02 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2020-08-21 23:58:10 +0100 |
commit | 3fc3d712a99cf39f69a2258b48cbc81fa8ae5471 (patch) | |
tree | 81952bd1932ea7188fc904e36a9aad6cb1bfb4a5 | |
parent | b97eb35308e1f57c997093a1d9830b58ad88915a (diff) | |
download | ffmpeg-3fc3d712a99cf39f69a2258b48cbc81fa8ae5471.tar.gz |
avcodec/libaomdec: Set SAR based on RenderWidth and RenderHeight
This is the same thing we do in libdav1d.c
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavcodec/libaomdec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c index a72ac984e7..1430a651fe 100644 --- a/libavcodec/libaomdec.c +++ b/libavcodec/libaomdec.c @@ -197,6 +197,14 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame, } if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) return ret; + + av_reduce(&picture->sample_aspect_ratio.num, + &picture->sample_aspect_ratio.den, + picture->height * img->r_w, + picture->width * img->r_h, + INT_MAX); + ff_set_sar(avctx, picture->sample_aspect_ratio); + if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8) image_copy_16_to_8(picture, img); else |