avformat/matroskaenc: use r_frame_rate as fallback to set a track's DefaultDuration

Signed-off-by: James Almer <jamrial@gmail.com>
pull/323/head
James Almer 5 years ago
parent 66d45af13c
commit 5f758c31f9
  1. 3
      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) &&

Loading…
Cancel
Save