From e3fb5bc1472c600af628df10e1472a4319781640 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 2 Oct 2012 00:41:40 +0200 Subject: nut: store and read the r_frame_rate With this, when we use a finer timebase than neccessary to store durations the demuxer still knows what the original timebase was. Signed-off-by: Michael Niedermayer --- libavformat/nutenc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavformat/nutenc.c') diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 955a6fb..5133ade 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -485,6 +485,11 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id){ if (st->disposition & ff_nut_dispositions[i].flag) count += add_info(dyn_bc, "Disposition", ff_nut_dispositions[i].str); } + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + uint8_t buf[256]; + snprintf(buf, sizeof(buf), "%d/%d", st->codec->time_base.den, st->codec->time_base.num); + count += add_info(dyn_bc, "r_frame_rate", buf); + } dyn_size = avio_close_dyn_buf(dyn_bc, &dyn_buf); if (count) { -- cgit v1.1