Commit 60aaf044 authored by Marton Balint's avatar Marton Balint

audioconvert: add av_get_default_channel_layout public function

parent 2446a8cc
......@@ -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;
}
......@@ -92,4 +92,9 @@ void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int6
*/
int av_get_channel_layout_nb_channels(int64_t channel_layout);
/**
* Return default channel layout for a given number of channels.
*/
int av_get_default_channel_layout(int nb_channels);
#endif /* AVUTIL_AUDIOCONVERT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment