diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-04-19 14:05:55 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-04-19 14:05:55 +0000 |
commit | be233a569165ad39a63ff2137763a123cd4f2562 (patch) | |
tree | e4445370847f8297dad61cf77ed50443cae64fa1 /libavcodec/audioconvert.c | |
parent | dc1ed614328edaf05745925392a2765c0ed49c92 (diff) | |
download | ffmpeg-be233a569165ad39a63ff2137763a123cd4f2562.tar.gz |
Check that channel layout is compatible with number of channels for
output audio stream.
Originally committed as revision 18621 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/audioconvert.c')
-rw-r--r-- | libavcodec/audioconvert.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index b0a8afacb4..5842801093 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -153,6 +153,15 @@ void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, } } +int avcodec_channel_layout_num_channels(int64_t channel_layout) +{ + int count; + uint64_t x = channel_layout; + for (count = 0; x; count++) + x &= x-1; // unset lowest set bit + return count; +} + struct AVAudioConvert { int in_channels, out_channels; int fmt_pair; |