mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
PCM: Introduce snd_pcm_chmap_t and snd_pcm_chmap_query_t
Instead of passing ambiguous integer array, define snd_pcm_chmap_t and snd_pcm_chmap_query_t so that user can understand more easily which element is for what. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
48c2c90f19
commit
9c1a0ce72d
15 changed files with 102 additions and 84 deletions
|
|
@ -703,10 +703,10 @@ snd_pcm_route_read_areas(snd_pcm_t *pcm,
|
|||
return size;
|
||||
}
|
||||
|
||||
static int *snd_pcm_route_get_chmap(snd_pcm_t *pcm)
|
||||
static snd_pcm_chmap_t *snd_pcm_route_get_chmap(snd_pcm_t *pcm)
|
||||
{
|
||||
snd_pcm_route_t *route = pcm->private_data;
|
||||
int *map, *slave_map;
|
||||
snd_pcm_chmap_t *map, *slave_map;
|
||||
unsigned int src, dst;
|
||||
|
||||
slave_map = snd_pcm_generic_get_chmap(pcm);
|
||||
|
|
@ -717,13 +717,13 @@ static int *snd_pcm_route_get_chmap(snd_pcm_t *pcm)
|
|||
free(slave_map);
|
||||
return NULL;
|
||||
}
|
||||
*map = route->schannels;
|
||||
map->channels = route->schannels;
|
||||
for (dst = 0; dst < route->params.ndsts; dst++) {
|
||||
snd_pcm_route_ttable_dst_t *d = &route->params.dsts[dst];
|
||||
for (src = 0; src < d->nsrcs; src++) {
|
||||
int c = d->srcs[src].channel;
|
||||
if (c < route->schannels && !map[c + 1])
|
||||
map[c + 1] = slave_map[dst + 1];
|
||||
if (c < route->schannels && !map->pos[c])
|
||||
map->pos[c] = slave_map->pos[dst];
|
||||
}
|
||||
}
|
||||
free(slave_map);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue