[FFmpeg-cvslog] r20512 - in trunk: libavcodec/avcodec.h libavcodec/mpeg4audio.c libavcodec/mpeg4audio.h libavformat/flvdec.c libavformat/mov.c

alexc subversion
Wed Nov 11 21:24:23 CET 2009


Author: alexc
Date: Wed Nov 11 21:24:23 2009
New Revision: 20512

Log:
Add a channels field to MPEG4AudioConfig.

Modified:
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/mpeg4audio.c
   trunk/libavcodec/mpeg4audio.h
   trunk/libavformat/flvdec.c
   trunk/libavformat/mov.c

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Wed Nov 11 12:00:50 2009	(r20511)
+++ trunk/libavcodec/avcodec.h	Wed Nov 11 21:24:23 2009	(r20512)
@@ -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, \

Modified: trunk/libavcodec/mpeg4audio.c
==============================================================================
--- trunk/libavcodec/mpeg4audio.c	Wed Nov 11 12:00:50 2009	(r20511)
+++ trunk/libavcodec/mpeg4audio.c	Wed Nov 11 21:24:23 2009	(r20512)
@@ -57,6 +57,8 @@ int ff_mpeg4audio_get_config(MPEG4AudioC
     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;

Modified: trunk/libavcodec/mpeg4audio.h
==============================================================================
--- trunk/libavcodec/mpeg4audio.h	Wed Nov 11 12:00:50 2009	(r20511)
+++ trunk/libavcodec/mpeg4audio.h	Wed Nov 11 21:24:23 2009	(r20512)
@@ -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];

Modified: trunk/libavformat/flvdec.c
==============================================================================
--- trunk/libavformat/flvdec.c	Wed Nov 11 12:00:50 2009	(r20511)
+++ trunk/libavformat/flvdec.c	Wed Nov 11 21:24:23 2009	(r20512)
@@ -410,9 +410,7 @@ static int flv_read_packet(AVFormatConte
                 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);

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	Wed Nov 11 12:00:50 2009	(r20511)
+++ trunk/libavformat/mov.c	Wed Nov 11 21:24:23 2009	(r20512)
@@ -434,9 +434,7 @@ int ff_mov_read_esds(AVFormatContext *fc
                 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



More information about the ffmpeg-cvslog mailing list