[FFmpeg-cvslog] commit: Make av_get_channel_layout_string() guess the number of channels if it (Stefano Sabatini )

git at videolan.org git
Thu Jan 13 10:33:51 CET 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Thu Jan 13 01:00:31 2011 +0000| [8b69c2f4638da056591ac3dfee238b83f1eb74b2] | committer: Stefano Sabatini 

Make av_get_channel_layout_string() guess the number of channels if it
was not provided.

Originally committed as revision 26324 to svn://svn.ffmpeg.org/ffmpeg/trunk

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

 libavcore/audioconvert.c |    3 +++
 libavcore/audioconvert.h |    1 +
 libavcore/avcore.h       |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcore/audioconvert.c b/libavcore/audioconvert.c
index 171d6b1..c720733 100644
--- a/libavcore/audioconvert.c
+++ b/libavcore/audioconvert.c
@@ -78,6 +78,9 @@ void av_get_channel_layout_string(char *buf, int buf_size,
 {
     int i;
 
+    if (nb_channels <= 0)
+        nb_channels = av_get_channel_layout_nb_channels(channel_layout);
+
     for (i = 0; channel_layout_map[i].name; i++)
         if (nb_channels    == channel_layout_map[i].nb_channels &&
             channel_layout == channel_layout_map[i].layout) {
diff --git a/libavcore/audioconvert.h b/libavcore/audioconvert.h
index 0c6b979..89e9c55 100644
--- a/libavcore/audioconvert.h
+++ b/libavcore/audioconvert.h
@@ -80,6 +80,7 @@ int64_t av_get_channel_layout(const char *name);
 
 /**
  * Return a description of a channel layout.
+ * If nb_channels is <= 0, it is guessed from the channel_layout.
  *
  * @param buf put here the string containing the channel layout
  * @param buf_size size in bytes of the buffer
diff --git a/libavcore/avcore.h b/libavcore/avcore.h
index 714eac4..9b02c3b 100644
--- a/libavcore/avcore.h
+++ b/libavcore/avcore.h
@@ -28,7 +28,7 @@
 
 #define LIBAVCORE_VERSION_MAJOR  0
 #define LIBAVCORE_VERSION_MINOR 16
-#define LIBAVCORE_VERSION_MICRO  0
+#define LIBAVCORE_VERSION_MICRO  1
 
 #define LIBAVCORE_VERSION_INT   AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \
                                                LIBAVCORE_VERSION_MINOR, \




More information about the ffmpeg-cvslog mailing list