avformat/isom: utilize bitrate hints

Fixes Ticket4546

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Ganesh Ajjanagadde 2015-07-12 10:33:37 -04:00 committed by Michael Niedermayer
parent 774ceee17e
commit 4547cf68a0
1 changed files with 7 additions and 2 deletions

View File

@ -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;