[FFmpeg-cvslog] avformat/nutenc: store the actual r_frame_rate in the corresponding field if available

Michael Niedermayer git at videolan.org
Sun Dec 14 02:22:44 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 14 01:12:27 2014 +0100| [3b537eab27bb34f5f63b06097fbd52ff5941c3f6] | committer: Michael Niedermayer

avformat/nutenc: store the actual r_frame_rate in the corresponding field if available

Fixes Ticket 3629 part3

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3b537eab27bb34f5f63b06097fbd52ff5941c3f6
---

 libavformat/nutenc.c  |    5 ++++-
 libavformat/version.h |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 3424e26..c335e64 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);
diff --git a/libavformat/version.h b/libavformat/version.h
index 5e73353..6664f2b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
 #define LIBAVFORMAT_VERSION_MINOR  15
-#define LIBAVFORMAT_VERSION_MICRO 104
+#define LIBAVFORMAT_VERSION_MICRO 105
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list