diff options
author | Marton Balint <cus@passwd.hu> | 2011-10-02 16:28:36 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2011-10-02 21:21:46 +0200 |
commit | 60aaf044f3fdbeb1cf702b144cb0597ce4988020 (patch) | |
tree | cda15cfb92db32d3583656bbabd5d5873e5af3cf /libavutil/audioconvert.c | |
parent | 2446a8cc0a4d6c848f80a3c0a5917a4b4b9f3259 (diff) | |
download | ffmpeg-60aaf044f3fdbeb1cf702b144cb0597ce4988020.tar.gz |
audioconvert: add av_get_default_channel_layout public function
Diffstat (limited to 'libavutil/audioconvert.c')
-rw-r--r-- | libavutil/audioconvert.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c index 524f6f9e9e..4a8794276e 100644 --- a/libavutil/audioconvert.c +++ b/libavutil/audioconvert.c @@ -131,3 +131,11 @@ int av_get_channel_layout_nb_channels(int64_t channel_layout) x &= x-1; // unset lowest set bit return count; } + +int av_get_default_channel_layout(int nb_channels) { + int i; + for (i = 0; channel_layout_map[i].name; i++) + if (nb_channels == channel_layout_map[i].nb_channels) + return channel_layout_map[i].layout; + return 0; +} |