diff options
author | James Almer <jamrial@gmail.com> | 2019-10-01 12:58:20 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-10-06 13:44:52 -0300 |
commit | 5f758c31f9af6550a657ec2785c8c34838924e76 (patch) | |
tree | 4ea3f8e49cf462fe122db7ab387273a3378b8847 /libavformat | |
parent | 66d45af13c043d2bb555cef462d73906761ea1ba (diff) | |
download | ffmpeg-5f758c31f9af6550a657ec2785c8c34838924e76.tar.gz |
avformat/matroskaenc: use r_frame_rate as fallback to set a track's DefaultDuration
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskaenc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index a64ffdb690..37706e56c7 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1311,6 +1311,9 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv, if( st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0 && av_cmp_q(av_inv_q(st->avg_frame_rate), st->time_base) > 0) put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * st->avg_frame_rate.den / st->avg_frame_rate.num); + else if( st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0 + && av_cmp_q(av_inv_q(st->r_frame_rate), st->time_base) > 0) + put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * st->r_frame_rate.den / st->r_frame_rate.num); if (!native_id && ff_codec_get_tag(ff_codec_movvideo_tags, par->codec_id) && |