From 194be1f43ea391eb986732707435176e579265aa Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 18 May 2014 12:12:59 +0200 Subject: lavf: switch to AVStream.time_base as the hint for the muxer timebase Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion). --- libavformat/mxfenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/mxfenc.c') diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 66beec2940..841e727791 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1433,11 +1433,12 @@ static int mxf_write_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "video stream must be first track\n"); return -1; } - if (fabs(av_q2d(st->codec->time_base) - 1/25.0) < 0.0001) { + // TODO: should be avg_frame_rate + if (fabs(av_q2d(st->time_base) - 1/25.0) < 0.0001) { samples_per_frame = PAL_samples_per_frame; mxf->time_base = (AVRational){ 1, 25 }; mxf->timecode_base = 25; - } else if (fabs(av_q2d(st->codec->time_base) - 1001/30000.0) < 0.0001) { + } else if (fabs(av_q2d(st->time_base) - 1001/30000.0) < 0.0001) { samples_per_frame = NTSC_samples_per_frame; mxf->time_base = (AVRational){ 1001, 30000 }; mxf->timecode_base = 30; -- cgit v1.2.3