aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-06-09 20:14:12 +0200
committerAnton Khirnov <anton@khirnov.net>2012-06-10 08:02:11 +0200
commit3596de55fc054b5c336e7e542c26ced0505d4f2e (patch)
treefc5c76c229b7e2abeaa1d7b1e0c959a363f85f3f /libavutil
parentd7d071a673b5ca7e59ae7cc888eaa1dc24fc4f5e (diff)
downloadffmpeg-3596de55fc054b5c336e7e542c26ced0505d4f2e.tar.gz
audioconvert: use av_popcount64 in av_get_channel_layout_nb_channels
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/audioconvert.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavutil/audioconvert.c b/libavutil/audioconvert.c
index 2560127aac..1a8e5ee239 100644
--- a/libavutil/audioconvert.c
+++ b/libavutil/audioconvert.c
@@ -175,11 +175,7 @@ void av_get_channel_layout_string(char *buf, int buf_size,
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
{
- int count;
- uint64_t x = channel_layout;
- for (count = 0; x; count++)
- x &= x-1; // unset lowest set bit
- return count;
+ return av_popcount64(channel_layout);
}
uint64_t av_get_default_channel_layout(int nb_channels)