diff --git a/ffserver.c b/ffserver.c
index f2cf67f..096c160 100644
|
a
|
b
|
static void compute_status(HTTPContext *c) |
| 2095 | 2095 | default: |
| 2096 | 2096 | abort(); |
| 2097 | 2097 | } |
| 2098 | | avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d<td>%s<td>%s\n", |
| | 2098 | avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%lld<td>%s<td>%s\n", |
| 2099 | 2099 | i, type, st->codec->bit_rate/1000, codec ? codec->name : "", parameters); |
| 2100 | 2100 | } |
| 2101 | 2101 | avio_printf(pb, "</table>\n"); |
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 012a31c..af10e55 100644
|
a
|
b
|
typedef struct AVCodecContext { |
| 1605 | 1605 | * - encoding: Set by user; unused for constant quantizer encoding. |
| 1606 | 1606 | * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. |
| 1607 | 1607 | */ |
| 1608 | | int bit_rate; |
| | 1608 | int64_t bit_rate; |
| 1609 | 1609 | |
| 1610 | 1610 | /** |
| 1611 | 1611 | * number of bits the bitstream is allowed to diverge from the reference. |
| … |
… |
typedef struct AVCodecContext { |
| 1613 | 1613 | * - encoding: Set by user; unused for constant quantizer encoding. |
| 1614 | 1614 | * - decoding: unused |
| 1615 | 1615 | */ |
| 1616 | | int bit_rate_tolerance; |
| | 1616 | int64_t bit_rate_tolerance; |
| 1617 | 1617 | |
| 1618 | 1618 | /** |
| 1619 | 1619 | * Global quality for codecs which cannot change it per frame. |
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c
index fe7c4a7..0f5c9a2 100644
|
a
|
b
|
static int pcm_bluray_parse_header(AVCodecContext *avctx, |
| 116 | 116 | |
| 117 | 117 | if (avctx->debug & FF_DEBUG_PICT_INFO) |
| 118 | 118 | av_dlog(avctx, |
| 119 | | "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n", |
| | 119 | "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %lld bit/s\n", |
| 120 | 120 | avctx->channels, avctx->bits_per_coded_sample, |
| 121 | 121 | avctx->sample_rate, avctx->bit_rate); |
| 122 | 122 | return 0; |
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index 06b22c0..708e2fc 100644
|
a
|
b
|
static av_cold int sipr_decoder_init(AVCodecContext * avctx) |
| 492 | 492 | else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5; |
| 493 | 493 | else ctx->mode = MODE_5k0; |
| 494 | 494 | av_log(avctx, AV_LOG_WARNING, |
| 495 | | "Invalid block_align: %d. Mode %s guessed based on bitrate: %d\n", |
| | 495 | "Invalid block_align: %d. Mode %s guessed based on bitrate: %lld\n", |
| 496 | 496 | avctx->block_align, modes[ctx->mode].mode_name, avctx->bit_rate); |
| 497 | 497 | } |
| 498 | 498 | |
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f5ceae4..5467db5 100644
|
a
|
b
|
static void avcodec_get_subtitle_defaults(AVSubtitle *sub) |
| 738 | 738 | sub->pts = AV_NOPTS_VALUE; |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | | static int get_bit_rate(AVCodecContext *ctx) |
| | 741 | static int64_t get_bit_rate(AVCodecContext *ctx) |
| 742 | 742 | { |
| 743 | | int bit_rate; |
| | 743 | int64_t bit_rate; |
| 744 | 744 | int bits_per_sample; |
| 745 | 745 | |
| 746 | 746 | switch (ctx->codec_type) { |
| … |
… |
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code |
| 1016 | 1016 | } |
| 1017 | 1017 | if ( (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) |
| 1018 | 1018 | && avctx->bit_rate>0 && avctx->bit_rate<1000) { |
| 1019 | | av_log(avctx, AV_LOG_WARNING, "Bitrate %d is extreemly low, did you mean %dk\n", avctx->bit_rate, avctx->bit_rate); |
| | 1019 | av_log(avctx, AV_LOG_WARNING, "Bitrate %lld is extreemly low, did you mean %lldk\n", avctx->bit_rate, avctx->bit_rate); |
| 1020 | 1020 | } |
| 1021 | 1021 | } |
| 1022 | 1022 | |
| … |
… |
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
| 2039 | 2039 | const char *codec_name; |
| 2040 | 2040 | const char *profile = NULL; |
| 2041 | 2041 | const AVCodec *p; |
| 2042 | | int bitrate; |
| | 2042 | int64_t bitrate; |
| 2043 | 2043 | AVRational display_aspect_ratio; |
| 2044 | 2044 | |
| 2045 | 2045 | if (!buf || buf_size <= 0) |
| … |
… |
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
| 2131 | 2131 | bitrate = get_bit_rate(enc); |
| 2132 | 2132 | if (bitrate != 0) { |
| 2133 | 2133 | snprintf(buf + strlen(buf), buf_size - strlen(buf), |
| 2134 | | ", %d kb/s", bitrate / 1000); |
| | 2134 | ", %lld kb/s", bitrate / 1000); |
| 2135 | 2135 | } |
| 2136 | 2136 | } |
| 2137 | 2137 | |
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index d0c0b34..077c547 100644
|
a
|
b
|
int ff_wma_init(AVCodecContext *avctx, int flags2) |
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | av_dlog(s->avctx, "flags2=0x%x\n", flags2); |
| 184 | | av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n", |
| | 184 | av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%lld block_align=%d\n", |
| 185 | 185 | s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate, |
| 186 | 186 | avctx->block_align); |
| 187 | 187 | av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n", |
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 5aebe81..590d561 100644
|
a
|
b
|
static int encode_init(AVCodecContext * avctx){ |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if(avctx->bit_rate < 24*1000) { |
| 48 | | av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %i, need 24000 or higher\n", |
| | 48 | av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %lli, need 24000 or higher\n", |
| 49 | 49 | avctx->bit_rate); |
| 50 | 50 | return AVERROR(EINVAL); |
| 51 | 51 | } |
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index c907d4e..0a6f496 100644
|
a
|
b
|
typedef struct AVFormatContext { |
| 1008 | 1008 | * available. Never set it directly if the file_size and the |
| 1009 | 1009 | * duration are known as FFmpeg can compute it automatically. |
| 1010 | 1010 | */ |
| 1011 | | int bit_rate; |
| | 1011 | int64_t bit_rate; |
| 1012 | 1012 | |
| 1013 | 1013 | unsigned int packet_size; |
| 1014 | 1014 | int max_delay; |
diff --git a/libavformat/g729dec.c b/libavformat/g729dec.c
index 794558e..39c12c4 100644
|
a
|
b
|
static int g729_read_header(AVFormatContext *s) |
| 57 | 57 | } else if (s->bit_rate == 8000) { |
| 58 | 58 | st->codec->block_align = 10; |
| 59 | 59 | } else { |
| 60 | | 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); |
| | 60 | av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %lld b/s\n", s->bit_rate); |
| 61 | 61 | return AVERROR_INVALIDDATA; |
| 62 | 62 | } |
| 63 | 63 | |
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f08aa7e..a8705ca 100644
|
a
|
b
|
static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov) |
| 2416 | 2416 | } else { |
| 2417 | 2417 | continue; |
| 2418 | 2418 | } |
| 2419 | | avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type, |
| | 2419 | avio_printf(pb, "<%s systemBitrate=\"%lld\">\n", type, |
| 2420 | 2420 | track->enc->bit_rate); |
| 2421 | 2421 | param_write_int(pb, "systemBitrate", track->enc->bit_rate); |
| 2422 | 2422 | param_write_int(pb, "trackID", track_id); |
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 695323a..6f88059 100644
|
a
|
b
|
real_parse_asm_rule(AVStream *st, const char *p, const char *end) |
| 443 | 443 | { |
| 444 | 444 | do { |
| 445 | 445 | /* can be either averagebandwidth= or AverageBandwidth= */ |
| 446 | | if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codec->bit_rate) == 1) |
| | 446 | if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%lld", &st->codec->bit_rate) == 1) |
| 447 | 447 | break; |
| 448 | 448 | if (!(p = strchr(p, ',')) || p > end) |
| 449 | 449 | p = end; |
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index cdc3e21..6a0cc93 100644
|
a
|
b
|
void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, |
| 624 | 624 | av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type); |
| 625 | 625 | sdp_write_address(buff, size, dest_addr, dest_type, ttl); |
| 626 | 626 | if (c->bit_rate) { |
| 627 | | av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000); |
| | 627 | av_strlcatf(buff, size, "b=AS:%lld\r\n", c->bit_rate / 1000); |
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | sdp_write_media_attributes(buff, size, c, payload_type, fmt); |
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 096bf79..ac82259 100644
|
a
|
b
|
static int write_manifest(AVFormatContext *s, int final) |
| 255 | 255 | if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO) |
| 256 | 256 | continue; |
| 257 | 257 | last = i; |
| 258 | | 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); |
| | 258 | avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%lld\" 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); |
| 259 | 259 | index++; |
| 260 | 260 | } |
| 261 | 261 | output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size); |
| … |
… |
static int write_manifest(AVFormatContext *s, int final) |
| 269 | 269 | if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO) |
| 270 | 270 | continue; |
| 271 | 271 | last = i; |
| 272 | | 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); |
| | 272 | avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%lld\" 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); |
| 273 | 273 | index++; |
| 274 | 274 | } |
| 275 | 275 | output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size); |
| … |
… |
static int ism_write_header(AVFormatContext *s) |
| 317 | 317 | ret = AVERROR(EINVAL); |
| 318 | 318 | goto fail; |
| 319 | 319 | } |
| 320 | | snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate); |
| | 320 | snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%lld)", s->filename, s->streams[i]->codec->bit_rate); |
| 321 | 321 | if (mkdir(os->dirname, 0777) < 0) { |
| 322 | 322 | ret = AVERROR(errno); |
| 323 | 323 | av_log(s, AV_LOG_ERROR, "mkdir failed\n"); |
diff --git a/libavformat/utils.c b/libavformat/utils.c
index a78da36..4bcae7f 100644
|
a
|
b
|
static void estimate_timings(AVFormatContext *ic, int64_t old_offset) |
| 2374 | 2374 | (double) st->start_time / AV_TIME_BASE, |
| 2375 | 2375 | (double) st->duration / AV_TIME_BASE); |
| 2376 | 2376 | } |
| 2377 | | av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n", |
| | 2377 | av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%lld kb/s\n", |
| 2378 | 2378 | (double) ic->start_time / AV_TIME_BASE, |
| 2379 | 2379 | (double) ic->duration / AV_TIME_BASE, |
| 2380 | 2380 | ic->bit_rate / 1000); |
| … |
… |
void av_dump_format(AVFormatContext *ic, |
| 3516 | 3516 | } |
| 3517 | 3517 | av_log(NULL, AV_LOG_INFO, ", bitrate: "); |
| 3518 | 3518 | if (ic->bit_rate) { |
| 3519 | | av_log(NULL, AV_LOG_INFO,"%d kb/s", ic->bit_rate / 1000); |
| | 3519 | av_log(NULL, AV_LOG_INFO,"%lld kb/s", ic->bit_rate / 1000); |
| 3520 | 3520 | } else { |
| 3521 | 3521 | av_log(NULL, AV_LOG_INFO, "N/A"); |
| 3522 | 3522 | } |
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index f1e6aaf..0ffb7cc 100644
|
a
|
b
|
static int vqf_read_header(AVFormatContext *s) |
| 200 | 200 | size = 2048; |
| 201 | 201 | break; |
| 202 | 202 | default: |
| 203 | | av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %d kb/s.\n", |
| | 203 | av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %lld kb/s.\n", |
| 204 | 204 | st->codec->sample_rate, st->codec->bit_rate); |
| 205 | 205 | return -1; |
| 206 | 206 | } |