]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Add a channels field to MPEG4AudioConfig.
authoralexc <alexc@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Nov 2009 20:24:23 +0000 (20:24 +0000)
committeralexc <alexc@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Nov 2009 20:24:23 +0000 (20:24 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20512 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/avcodec.h
libavcodec/mpeg4audio.c
libavcodec/mpeg4audio.h
libavformat/flvdec.c
libavformat/mov.c

index 5d470b0d54547ebf5a8a3b2d7745b15d828d10d5..6e56257aa68b6318066ee85177737d41c8ed676d 100644 (file)
@@ -30,8 +30,8 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 38
-#define LIBAVCODEC_VERSION_MICRO  1
+#define LIBAVCODEC_VERSION_MINOR 39
+#define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
index 6c0bc7d76a862e8de9414fa481fff11d19697946..8c9657273c25d1030cbcc5017e2dd78c5273e9b5 100644 (file)
@@ -57,6 +57,8 @@ int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_si
     c->object_type = get_object_type(&gb);
     c->sample_rate = get_sample_rate(&gb, &c->sampling_index);
     c->chan_config = get_bits(&gb, 4);
+    if (c->chan_config < FF_ARRAY_ELEMS(ff_mpeg4audio_channels))
+        c->channels = ff_mpeg4audio_channels[c->chan_config];
     c->sbr = -1;
     if (c->object_type == AOT_SBR) {
         c->ext_object_type = c->object_type;
index 5e3a1d39fb13f148de83660785d04330ccc6b864..c9eac18188ba06634133a6fea12aa9278978841a 100644 (file)
@@ -36,6 +36,7 @@ typedef struct {
     int ext_sampling_index;
     int ext_sample_rate;
     int ext_chan_config;
+    int channels;
 } MPEG4AudioConfig;
 
 extern const int ff_mpeg4audio_sample_rates[16];
index b3b3cc19305e4904fafbd810f21239ff70c8badb..27062dcb97e3ec993a8dffd2a9960b9238793733 100644 (file)
@@ -410,9 +410,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
                 MPEG4AudioConfig cfg;
                 ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
                                          st->codec->extradata_size);
-                if (cfg.chan_config > 7)
-                    return -1;
-                st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
+                st->codec->channels = cfg.channels;
                 st->codec->sample_rate = cfg.sample_rate;
                 dprintf(s, "mp4a config channels %d sample rate %d\n",
                         st->codec->channels, st->codec->sample_rate);
index 3d676308f91e83ef5dcd652ae2db04c21d0db5df..196f41d1b4fdff4b17e9063cd2409d3556810fa4 100644 (file)
@@ -434,9 +434,7 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
                 MPEG4AudioConfig cfg;
                 ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
                                          st->codec->extradata_size);
-                if (cfg.chan_config > 7)
-                    return -1;
-                st->codec->channels = ff_mpeg4audio_channels[cfg.chan_config];
+                st->codec->channels = cfg.channels;
                 if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
                     st->codec->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];
                 else