int use_getput;
unsigned int src_size;
snd_pcm_format_t dst_sfmt;
+ unsigned int nsrcs;
unsigned int ndsts;
snd_pcm_route_ttable_dst_t *dsts;
} snd_pcm_route_params_t;
{
snd_pcm_route_t *route = pcm->private_data;
snd_pcm_chmap_t *map, *slave_map;
- unsigned int src, dst;
+ unsigned int src, dst, nsrcs;
slave_map = snd_pcm_generic_get_chmap(pcm);
if (!slave_map)
return NULL;
- map = calloc(4, route->schannels + 1);
+ nsrcs = route->params.nsrcs;
+ map = calloc(4, nsrcs + 1);
if (!map) {
free(slave_map);
return NULL;
}
- map->channels = route->schannels;
+ map->channels = nsrcs;
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->pos[c])
+ if (c < nsrcs && !map->pos[c])
map->pos[c] = slave_map->pos[dst];
}
}
return map;
}
+static snd_pcm_chmap_query_t **snd_pcm_route_query_chmaps(snd_pcm_t *pcm)
+{
+ snd_pcm_chmap_query_t **maps;
+ snd_pcm_chmap_t *map = snd_pcm_route_get_chmap(pcm);
+ if (!map)
+ return NULL;
+ maps = _snd_pcm_make_single_query_chmaps(map);
+ free(map);
+ return maps;
+}
+
static void snd_pcm_route_dump(snd_pcm_t *pcm, snd_output_t *out)
{
snd_pcm_route_t *route = pcm->private_data;
.async = snd_pcm_generic_async,
.mmap = snd_pcm_generic_mmap,
.munmap = snd_pcm_generic_munmap,
- .query_chmaps = NULL, /* NYI */
+ .query_chmaps = snd_pcm_route_query_chmaps,
.get_chmap = snd_pcm_route_get_chmap,
.set_chmap = NULL, /* NYI */
};
dmul = tt_ssize;
}
params->ndsts = dused;
+ params->nsrcs = sused;
dptr = calloc(dused, sizeof(*params->dsts));
if (!dptr)
return -ENOMEM;