diff options
author | Ganesh Ajjanagadde <gajjanagadde@gmail.com> | 2015-07-12 10:33:37 -0400 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-12 20:23:58 +0200 |
commit | 4547cf68a0d28c01549f84567e4d39a8b40230e7 (patch) | |
tree | 40854e31ed37a95371ccc058b65f38de4bb543a8 /libavformat/isom.c | |
parent | 774ceee17ed9b6feb36bc6c25fc92dcf122da17d (diff) | |
download | ffmpeg-4547cf68a0d28c01549f84567e4d39a8b40230e7.tar.gz |
avformat/isom: utilize bitrate hints
Fixes Ticket4546
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r-- | libavformat/isom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c index db9129bcac..5673c512b0 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -451,19 +451,24 @@ static const AVCodecTag mp4_audio_types[] = { int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb) { enum AVCodecID codec_id; + unsigned v; int len, tag; int ret; int object_type_id = avio_r8(pb); avio_r8(pb); /* stream type */ avio_rb24(pb); /* buffer size db */ - avio_rb32(pb); /* max bitrate */ - avio_rb32(pb); /* avg bitrate */ if(avcodec_is_open(st->codec)) { av_log(fc, AV_LOG_DEBUG, "codec open in read_dec_config_descr\n"); return -1; } + v = avio_rb32(pb); + if (v < INT32_MAX) + st->codec->rc_max_rate = v; + + st->codec->bit_rate = avio_rb32(pb); /* avg bitrate */ + codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id); if (codec_id) st->codec->codec_id= codec_id; |