Based on a patch by Steve Swanson, swanysteve at gmail.
Fixes ticket #2089.
API changes, most recent first:
+2015-09-15 - lavf 57.1.100 - avformat.h
+ bit_rate was changed to 64bit, make sure you update any
+ printf() or other type sensitive code
+
2015-09-15 - lavc 57.2.100 - avcodec.h
bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update
any printf() or other type sensitive code
* available. Never set it directly if the file_size and the
* duration are known as FFmpeg can compute it automatically.
*/
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
int bit_rate;
+#else
+ int64_t bit_rate;
+#endif
unsigned int packet_size;
int max_delay;
}
av_log(NULL, AV_LOG_INFO, ", bitrate: ");
if (ic->bit_rate)
- av_log(NULL, AV_LOG_INFO, "%d kb/s", ic->bit_rate / 1000);
+ av_log(NULL, AV_LOG_INFO, "%"PRId64" kb/s", (int64_t)ic->bit_rate / 1000);
else
av_log(NULL, AV_LOG_INFO, "N/A");
av_log(NULL, AV_LOG_INFO, "\n");
} else if (s->bit_rate == 8000) {
st->codec->block_align = 10;
} else {
- av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %d b/s\n", s->bit_rate);
+ av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %"PRId64" b/s\n", (int64_t)s->bit_rate);
return AVERROR_INVALIDDATA;
}
/* compute the bitrate */
double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
(double) ic->duration;
- if (bitrate >= 0 && bitrate <= INT_MAX)
+ if (bitrate >= 0 && (!AV_HAVE_INCOMPATIBLE_LIBAV_ABI || bitrate <= INT_MAX))
ic->bit_rate = bitrate;
}
}
(double) st->duration / AV_TIME_BASE);
}
av_log(ic, AV_LOG_TRACE,
- "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
+ "stream: start_time: %0.3f duration: %0.3f bitrate=%"PRId64" kb/s\n",
(double) ic->start_time / AV_TIME_BASE,
(double) ic->duration / AV_TIME_BASE,
- ic->bit_rate / 1000);
+ (int64_t)ic->bit_rate / 1000);
}
}
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 57
-#define LIBAVFORMAT_VERSION_MINOR 0
+#define LIBAVFORMAT_VERSION_MINOR 1
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \