aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/av1_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-01-07 12:21:33 -0300
committerJames Almer <jamrial@gmail.com>2023-01-10 09:08:09 -0300
commit0431f9805e7501e48aada71ced37a10f6afbe141 (patch)
treefb17f2669fc645e5373264ce59711e1064437901 /libavcodec/av1_parser.c
parent54c0e72b42ad38b0ee5ca9c69873df17e4c51d6f (diff)
downloadffmpeg-0431f9805e7501e48aada71ced37a10f6afbe141.tar.gz
avcodec/av1_parser: export timing information when present
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1_parser.c')
-rw-r--r--libavcodec/av1_parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 4cbd7408a0..e57e382757 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -162,6 +162,12 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
avctx->color_trc = (enum AVColorTransferCharacteristic) color->transfer_characteristics;
avctx->color_range = color->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
+ if (seq->timing_info_present_flag) {
+ const AV1RawTimingInfo *timing = &seq->timing_info;
+ av_reduce(&avctx->framerate.den, &avctx->framerate.num,
+ timing->num_units_in_display_tick, timing->time_scale, INT_MAX);
+ }
+
if (avctx->framerate.num)
avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));