summaryrefslogtreecommitdiff
path: root/libavcodec/av1_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-11-10 21:09:51 -0300
committerJames Almer <jamrial@gmail.com>2019-11-12 22:21:40 -0300
commit0b8742521fa226dd0467d7a7f457b5018d96b22a (patch)
tree95ccff095a82f9ffffffcdd61ef7304bffe3539e /libavcodec/av1_parser.c
parent72ec3358f44c2705cc544e2d6dcd403f73fca2f8 (diff)
avcodec/av1_parser: export bitstream timing info when available
Based on h264_parser code. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/av1_parser.c')
-rw-r--r--libavcodec/av1_parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index b916608d65..510cad987b 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -157,6 +157,9 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
av_assert2(ctx->format != AV_PIX_FMT_NONE);
}
+ if (avctx->framerate.num)
+ avctx->time_base = av_inv_q(av_mul_q(avctx->framerate, (AVRational){avctx->ticks_per_frame, 1}));
+
end:
ff_cbs_fragment_reset(s->cbc, td);