[FFmpeg-cvslog] avformat/isom: utilize bitrate hints

Ganesh Ajjanagadde git at videolan.org
Sun Jul 12 20:34:46 CEST 2015


ffmpeg | branch: master | Ganesh Ajjanagadde <gajjanagadde at gmail.com> | Sun Jul 12 10:33:37 2015 -0400| [4547cf68a0d28c01549f84567e4d39a8b40230e7] | committer: Michael Niedermayer

avformat/isom: utilize bitrate hints

Fixes Ticket4546

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4547cf68a0d28c01549f84567e4d39a8b40230e7
---

 libavformat/isom.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index db9129b..5673c51 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;



More information about the ffmpeg-cvslog mailing list