diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-04 08:47:33 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-05-15 14:17:49 +0200 |
commit | e10a5b91bc1b138174ab2661171038431ca44213 (patch) | |
tree | 7b3e89ed37f2e308a2e1d844eca56ae0cb27fd8b /libavcodec/av1_parser.c | |
parent | 7be945a011917f3cff0ca8d7c09e0a71fe31d2c2 (diff) | |
download | ffmpeg-e10a5b91bc1b138174ab2661171038431ca44213.tar.gz |
lavc/av1*: fix exporting framerate
* take num_ticks_per_picture_minus_1 into account, since that is a part
of the framerate computation
* stop exporting num_ticks_per_picture_minus_1 into
AVCodecContext.ticks_per_frame, as that field is used for other
purposes (in conjunction with repeat_pict, which is not used at all by
av1)
Diffstat (limited to 'libavcodec/av1_parser.c')
-rw-r--r-- | libavcodec/av1_parser.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c index 14dae92fe9..2b79493bf8 100644 --- a/libavcodec/av1_parser.c +++ b/libavcodec/av1_parser.c @@ -21,6 +21,8 @@ */ #include "libavutil/avassert.h" + +#include "av1_parse.h" #include "cbs.h" #include "cbs_av1.h" #include "parser.h" @@ -162,11 +164,10 @@ 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 (seq->timing_info_present_flag) + avctx->framerate = ff_av1_framerate(1LL + seq->timing_info.num_ticks_per_picture_minus_1, + seq->timing_info.num_units_in_display_tick, + seq->timing_info.time_scale); end: ff_cbs_fragment_reset(td); |