Browse code

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

Stefano Sabatini authored on 2011/01/13 10:00:31
Showing 3 changed files
... ...
@@ -78,6 +78,9 @@ void av_get_channel_layout_string(char *buf, int buf_size,
78 78
 {
79 79
     int i;
80 80
 
81
+    if (nb_channels <= 0)
82
+        nb_channels = av_get_channel_layout_nb_channels(channel_layout);
83
+
81 84
     for (i = 0; channel_layout_map[i].name; i++)
82 85
         if (nb_channels    == channel_layout_map[i].nb_channels &&
83 86
             channel_layout == channel_layout_map[i].layout) {
... ...
@@ -80,6 +80,7 @@ int64_t av_get_channel_layout(const char *name);
80 80
 
81 81
 /**
82 82
  * Return a description of a channel layout.
83
+ * If nb_channels is <= 0, it is guessed from the channel_layout.
83 84
  *
84 85
  * @param buf put here the string containing the channel layout
85 86
  * @param buf_size size in bytes of the buffer
... ...
@@ -28,7 +28,7 @@
28 28
 
29 29
 #define LIBAVCORE_VERSION_MAJOR  0
30 30
 #define LIBAVCORE_VERSION_MINOR 16
31
-#define LIBAVCORE_VERSION_MICRO  0
31
+#define LIBAVCORE_VERSION_MICRO  1
32 32
 
33 33
 #define LIBAVCORE_VERSION_INT   AV_VERSION_INT(LIBAVCORE_VERSION_MAJOR, \
34 34
                                                LIBAVCORE_VERSION_MINOR, \