From 3b537eab27bb34f5f63b06097fbd52ff5941c3f6 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 14 Dec 2014 01:12:27 +0100 Subject: avformat/nutenc: store the actual r_frame_rate in the corresponding field if available Fixes Ticket 3629 part3 Signed-off-by: Michael Niedermayer --- libavformat/nutenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat/nutenc.c') diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 3424e26edb..c335e6455a 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -524,7 +524,10 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) { } 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); + if (st->r_frame_rate.num>0 && st->r_frame_rate.den>0) + snprintf(buf, sizeof(buf), "%d/%d", st->r_frame_rate.num, st->r_frame_rate.den); + else + 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); -- cgit v1.2.3