]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/audioconvert.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavcodec / audioconvert.c
index b0a8afacb4ffe2c46e8edf8cc532e96b9c8a6356..5842801093afceec1515b8c1786965607428e616 100644 (file)
@@ -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;