]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/libdav1d: export frame sample aspect ratio
authorJames Almer <jamrial@gmail.com>
Mon, 18 May 2020 15:28:03 +0000 (12:28 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 18 May 2020 15:28:03 +0000 (12:28 -0300)
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/libdav1d.c

index 5248e3f9f56ffe7d48f4f0d3f84182c87f80c8d6..bbb3ec1e6c048440a6732a4505692ff472b2455d 100644 (file)
@@ -267,6 +267,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);
+
     switch (p->seq_hdr->chr) {
     case DAV1D_CHR_VERTICAL:
         frame->chroma_location = c->chroma_sample_location = AVCHROMA_LOC_LEFT;