Browse code

Implement avcodec_get_channel_layout().

Patch by S.N. Hemanth Meenakshisundaram smeenaks:ucsd+edu.

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

S.N. Hemanth Meenakshisundaram authored on 2010/08/26 09:38:25
Showing 3 changed files
... ...
@@ -121,6 +121,18 @@ static const struct {
121 121
     { 0 }
122 122
 };
123 123
 
124
+int64_t avcodec_get_channel_layout(const char *name)
125
+{
126
+    int i = 0;
127
+    do {
128
+        if (!strcmp(channel_layout_map[i].name, name))
129
+            return channel_layout_map[i].layout;
130
+        i++;
131
+    } while (channel_layout_map[i].name);
132
+
133
+    return 0;
134
+}
135
+
124 136
 void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout)
125 137
 {
126 138
     int i;
... ...
@@ -60,6 +60,11 @@ enum SampleFormat avcodec_get_sample_fmt(const char* name);
60 60
 const char *avcodec_get_channel_name(int channel_id);
61 61
 
62 62
 /**
63
+ * @return channel layout that matches name, 0 if no match
64
+ */
65
+int64_t avcodec_get_channel_layout(const char *name);
66
+
67
+/**
63 68
  * Return description of channel layout
64 69
  */
65 70
 void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
... ...
@@ -30,8 +30,8 @@
30 30
 #include "libavutil/avutil.h"
31 31
 
32 32
 #define LIBAVCODEC_VERSION_MAJOR 52
33
-#define LIBAVCODEC_VERSION_MINOR 86
34
-#define LIBAVCODEC_VERSION_MICRO  1
33
+#define LIBAVCODEC_VERSION_MINOR 87
34
+#define LIBAVCODEC_VERSION_MICRO  0
35 35
 
36 36
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
37 37
                                                LIBAVCODEC_VERSION_MINOR, \