[FFmpeg-devel] [PATCH 2/2] avcodec/libdav1d: export frame sample aspect ratio

James Almer jamrial at gmail.com
Mon May 11 17:27:56 EEST 2020


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/libdav1d.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 72f06c550e..a265a487d8 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -335,6 +335,12 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
             goto fail;
     }
 
+    av_reduce(&frame->sample_aspect_ratio.num,
+              &frame->sample_aspect_ratio.den,
+              frame->height * (int64_t)p->frame_hdr->render_width,
+              frame->width  * (int64_t)p->frame_hdr->render_height,
+              INT_MAX);
+
     if (p->m.user_data.data)
         memcpy(&frame->reordered_opaque, p->m.user_data.data, sizeof(frame->reordered_opaque));
     else
-- 
2.26.2



More information about the ffmpeg-devel mailing list