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/rmenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat/rmenc.c') diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index fba8feb802..9ff9f318a5 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -310,6 +310,8 @@ static int rm_write_header(AVFormatContext *s) AVCodecContext *codec; for(n=0;nnb_streams;n++) { + AVStream *st = s->streams[n]; + s->streams[n]->id = n; codec = s->streams[n]->codec; stream = &rm->streams[n]; @@ -329,7 +331,8 @@ static int rm_write_header(AVFormatContext *s) break; case AVMEDIA_TYPE_VIDEO: rm->video_stream = stream; - stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num; + // TODO: should be avg_frame_rate + stream->frame_rate = (float)st->time_base.den / (float)st->time_base.num; /* XXX: dummy values */ stream->packet_max_size = 4096; stream->nb_packets = 0; -- cgit v1.2.3