diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 4ac6a2d715..57be9e6ef6 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2894,8 +2894,12 @@ static int mxf_init(AVFormatContext *s) if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(st->codecpar->format); - // TODO: should be avg_frame_rate - AVRational tbc = st->time_base; + AVRational tbc = (AVRational){ 0, 0 }; + if (st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0) + tbc = av_inv_q(st->avg_frame_rate); + else if (st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0) + tbc = av_inv_q(st->r_frame_rate); + // Default component depth to 8 sc->component_depth = 8; sc->h_chroma_sub_sample = 2; diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base index fd6cac53fc..23875d1fb8 100644 --- a/tests/ref/fate/time_base +++ b/tests/ref/fate/time_base @@ -1 +1 @@ -d408aba82d62a90ed7f46a1999b014f1 +b28d4ca13029fdc80a114b56467be9d7