Commit 3b537eab authored by Michael Niedermayer's avatar Michael Niedermayer

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

Fixes Ticket 3629 part3
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 28a6f970
...@@ -524,6 +524,9 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) { ...@@ -524,6 +524,9 @@ static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) {
} }
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
uint8_t buf[256]; uint8_t buf[256];
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); 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); count += add_info(dyn_bc, "r_frame_rate", buf);
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 56 #define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 15 #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, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \ LIBAVFORMAT_VERSION_MINOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment