diff options
author | James Almer <jamrial@gmail.com> | 2019-11-10 21:10:05 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-11-12 22:21:45 -0300 |
commit | 97d9cff251ee9aece9b748f6ef51eeec9b451815 (patch) | |
tree | 55ebc2be80886197b239068959a23f1b942bb1df /libavcodec | |
parent | 0b8742521fa226dd0467d7a7f457b5018d96b22a (diff) | |
download | ffmpeg-97d9cff251ee9aece9b748f6ef51eeec9b451815.tar.gz |
avcodec/libdav1d: export bitstream timing info when available
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libdav1d.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 98737cb162..cf4b178f1d 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -287,6 +287,13 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) else frame->reordered_opaque = AV_NOPTS_VALUE; + if (p->seq_hdr->num_units_in_tick && p->seq_hdr->time_scale) { + av_reduce(&c->framerate.den, &c->framerate.num, + p->seq_hdr->num_units_in_tick, p->seq_hdr->time_scale, INT_MAX); + if (p->seq_hdr->equal_picture_interval) + c->ticks_per_frame = p->seq_hdr->num_ticks_per_picture; + } + // match timestamps and packet size frame->pts = frame->best_effort_timestamp = p->m.timestamp; #if FF_API_PKT_PTS |