# HG changeset patch # User stefano # Date 1282783105 0 # Node ID d23e48091c5184decd3fd55324d8c6d4416a23a9 # Parent fbdc4391dedc9dc8a0ca6ca407e5f3ae760a5140 Implement avcodec_get_channel_layout(). Patch by S.N. Hemanth Meenakshisundaram smeenaks:ucsd+edu. diff -r fbdc4391dedc -r d23e48091c51 audioconvert.c --- a/audioconvert.c Wed Aug 25 20:36:35 2010 +0000 +++ b/audioconvert.c Thu Aug 26 00:38:25 2010 +0000 @@ -121,6 +121,18 @@ { 0 } }; +int64_t avcodec_get_channel_layout(const char *name) +{ + int i = 0; + do { + if (!strcmp(channel_layout_map[i].name, name)) + return channel_layout_map[i].layout; + i++; + } while (channel_layout_map[i].name); + + return 0; +} + void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout) { int i; diff -r fbdc4391dedc -r d23e48091c51 audioconvert.h --- a/audioconvert.h Wed Aug 25 20:36:35 2010 +0000 +++ b/audioconvert.h Thu Aug 26 00:38:25 2010 +0000 @@ -60,6 +60,11 @@ const char *avcodec_get_channel_name(int channel_id); /** + * @return channel layout that matches name, 0 if no match + */ +int64_t avcodec_get_channel_layout(const char *name); + +/** * Return description of channel layout */ void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout); diff -r fbdc4391dedc -r d23e48091c51 avcodec.h --- a/avcodec.h Wed Aug 25 20:36:35 2010 +0000 +++ b/avcodec.h Thu Aug 26 00:38:25 2010 +0000 @@ -30,8 +30,8 @@ #include "libavutil/avutil.h" #define LIBAVCODEC_VERSION_MAJOR 52 -#define LIBAVCODEC_VERSION_MINOR 86 -#define LIBAVCODEC_VERSION_MICRO 1 +#define LIBAVCODEC_VERSION_MINOR 87 +#define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \