diff options
author | S.N. Hemanth Meenakshisundaram <smeenaks@ucsd.edu> | 2010-08-26 00:38:25 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-08-26 00:38:25 +0000 |
commit | 5da19b53c6e16c6ff86ee9aab4f8d0b4b1c3be5d (patch) | |
tree | dcc8d039451539801d37ed5c0efb0c7f982372be | |
parent | f06d6c751f708a6a145bbf87520e7f59140bbbb2 (diff) | |
download | ffmpeg-streaming-5da19b53c6e16c6ff86ee9aab4f8d0b4b1c3be5d.zip ffmpeg-streaming-5da19b53c6e16c6ff86ee9aab4f8d0b4b1c3be5d.tar.gz |
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
-rw-r--r-- | libavcodec/audioconvert.c | 12 | ||||
-rw-r--r-- | libavcodec/audioconvert.h | 5 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 4 |
3 files changed, 19 insertions, 2 deletions
diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index d022bc9..c6dc1b1 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -121,6 +121,18 @@ static const struct { { 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 --git a/libavcodec/audioconvert.h b/libavcodec/audioconvert.h index 81b6cde..1f93b5c 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -60,6 +60,11 @@ enum SampleFormat avcodec_get_sample_fmt(const char* name); 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 --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 042b5c9..620f4ec 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -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, \ |