aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-15 18:01:32 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2015-09-15 18:02:43 +0200
commit7404f3bdb90e6a5dcb59bc0a091e2c5c038e557d (patch)
tree08d1d4010e20cd696e358bf03f9e2565f3256e0c /libavformat
parent28e023377cfe42c5406441eeff32842c1bb1f09f (diff)
downloadffmpeg-7404f3bdb90e6a5dcb59bc0a091e2c5c038e557d.tar.gz
lavc: Switch bitrate to 64bit unless compatibility with avconv was requested.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c4
-rw-r--r--libavformat/rdt.c4
-rw-r--r--libavformat/sdp.c2
-rw-r--r--libavformat/smoothstreamingenc.c6
-rw-r--r--libavformat/vqf.c4
5 files changed, 12 insertions, 8 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 08d0c2a772..af03d1e4bb 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3296,8 +3296,8 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
} else {
continue;
}
- avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type,
- track->enc->bit_rate);
+ avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
+ (int64_t)track->enc->bit_rate);
param_write_int(pb, "systemBitrate", track->enc->bit_rate);
param_write_int(pb, "trackID", track_id);
if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 046d2732a4..0e6ac8ec76 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -448,7 +448,11 @@ real_parse_asm_rule(AVStream *st, const char *p, const char *end)
{
do {
/* can be either averagebandwidth= or AverageBandwidth= */
+#if AV_HAVE_INCOMPATIBLE_LIBAV_ABI
if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codec->bit_rate) == 1)
+#else
+ if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%"SCNd64, &st->codec->bit_rate) == 1)
+#endif
break;
if (!(p = strchr(p, ',')) || p > end)
p = end;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 45974b394f..2ab37a8f5e 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -740,7 +740,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
sdp_write_address(buff, size, dest_addr, dest_type, ttl);
if (c->bit_rate) {
- av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
+ av_strlcatf(buff, size, "b=AS:%"PRId64"\r\n", (int64_t)c->bit_rate / 1000);
}
sdp_write_media_attributes(buff, size, c, payload_type, fmt);
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 07173a96f9..1ae3b49cf5 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -260,7 +260,7 @@ static int write_manifest(AVFormatContext *s, int final)
if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO)
continue;
last = i;
- avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->width, s->streams[i]->codec->height, os->private_str);
+ avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%"PRId64"\" FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" CodecPrivateData=\"%s\" />\n", index, (int64_t)s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->width, s->streams[i]->codec->height, os->private_str);
index++;
}
output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
@@ -274,7 +274,7 @@ static int write_manifest(AVFormatContext *s, int final)
if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
continue;
last = i;
- avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" BitsPerSample=\"16\" PacketSize=\"%d\" AudioTag=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->sample_rate, s->streams[i]->codec->channels, os->packet_size, os->audio_tag, os->private_str);
+ avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%"PRId64"\" FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" BitsPerSample=\"16\" PacketSize=\"%d\" AudioTag=\"%d\" CodecPrivateData=\"%s\" />\n", index, (int64_t)s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->sample_rate, s->streams[i]->codec->channels, os->packet_size, os->audio_tag, os->private_str);
index++;
}
output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
@@ -321,7 +321,7 @@ static int ism_write_header(AVFormatContext *s)
ret = AVERROR(EINVAL);
goto fail;
}
- snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate);
+ snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%"PRId64")", s->filename, (int64_t)s->streams[i]->codec->bit_rate);
if (mkdir(os->dirname, 0777) == -1 && errno != EEXIST) {
ret = AVERROR(errno);
av_log(s, AV_LOG_ERROR, "mkdir failed\n");
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 29c726dae9..06363a963c 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -211,8 +211,8 @@ static int vqf_read_header(AVFormatContext *s)
size = 2048;
break;
default:
- av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %d kb/s.\n",
- st->codec->sample_rate, st->codec->bit_rate);
+ av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %"PRId64" kb/s.\n",
+ st->codec->sample_rate, (int64_t)st->codec->bit_rate);
return -1;
}
c->frame_bit_len = st->codec->bit_rate*size/st->codec->sample_rate;