[FFmpeg-cvslog] avcodec/libdav1d: export frame sample aspect ratio
James Almer
git at videolan.org
Mon May 18 18:30:59 EEST 2020
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon May 18 12:28:03 2020 -0300| [49220869a82a344e3b22fe6a02239ed07e9b8d54] | committer: James Almer
avcodec/libdav1d: export frame sample aspect ratio
Reviewed-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49220869a82a344e3b22fe6a02239ed07e9b8d54
---
libavcodec/libdav1d.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 5248e3f9f5..bbb3ec1e6c 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list