Commit 5df320e1 authored by Anton Khirnov's avatar Anton Khirnov

audioconvert: add a function for getting the name of a single channel.

parent 406b257d
......@@ -202,3 +202,14 @@ int av_get_channel_layout_channel_index(uint64_t channel_layout,
channel_layout &= channel - 1;
return av_get_channel_layout_nb_channels(channel_layout);
}
const char *av_get_channel_name(uint64_t channel)
{
int i;
if (av_get_channel_layout_nb_channels(channel) != 1)
return NULL;
for (i = 0; i < 64; i++)
if ((1ULL<<i) & channel)
return get_channel_name(i);
return NULL;
}
......@@ -155,6 +155,13 @@ uint64_t av_get_default_channel_layout(int nb_channels);
int av_get_channel_layout_channel_index(uint64_t channel_layout,
uint64_t channel);
/**
* Get the name of a given channel.
*
* @return channel name on success, NULL on error.
*/
const char *av_get_channel_name(uint64_t channel);
/**
* @}
*/
......
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