diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index d022bc9ee3ee610293ecc564d304f5fe715ddce9..c6dc1b1c2a01c749adc12ad6564cc01d59280bf0 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 81b6cded39a1a332ab6dcff68d3450ef813932b1..1f93b5c336b1eb00b2582d23fad02911efc06b6a 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -59,6 +59,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 */ diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 042b5c9945dc9e3c264edc947fe0cc9cf35a863a..620f4ece241a32eb6a80c16f3653c8d72788d64c 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, \