History

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

Anton Khirnov committed 14 years ago

Commit 5df320e1 parent 406b2572 files · +18 −0Browse files

Unified · Split

2 files
  1. libavutil/audioconvert.c +11 −0
  2. libavutil/audioconvert.h +7 −0
libavutil/audioconvert.c+11−0
@@ -202,3 +202,14 @@ int av_get_channel_layout_channel_index(uint64_t channel_layout, · 201 unmodified lines
202 channel_layout &= channel - 1;202 channel_layout &= channel - 1;
203 return av_get_channel_layout_nb_channels(channel_layout);203 return av_get_channel_layout_nb_channels(channel_layout);
204}204}
205
206const char *av_get_channel_name(uint64_t channel)
207{
208 int i;
209 if (av_get_channel_layout_nb_channels(channel) != 1)
210 return NULL;
211 for (i = 0; i < 64; i++)
212 if ((1ULL<<i) & channel)
213 return get_channel_name(i);
214 return NULL;
215}
libavutil/audioconvert.h+7−0
@@ -155,6 +155,13 @@ uint64_t av_get_default_channel_layout(int nb_channels); · 154 unmodified lines
155int av_get_channel_layout_channel_index(uint64_t channel_layout,155int av_get_channel_layout_channel_index(uint64_t channel_layout,
156 uint64_t channel);156 uint64_t channel);
157 157
158/**
159 * Get the name of a given channel.
160 *
161 * @return channel name on success, NULL on error.
162 */
163const char *av_get_channel_name(uint64_t channel);
164
158/**165/**
159 * @}166 * @}
160 */167 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t