From 52db7a23a234080d3a28dfe60191c239cc04613b Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Thu, 1 Nov 2018 12:17:10 +1100 Subject: Only expose streams mapped to audiopaths on configure() cb When the configure() callback occurs for each audiopath, we only want those streams that are mapped to the given audiopath to be exposed to the audiopath. E.g. only streams mapped to loopback should be propagated to loopback via configure() callback, rather than all streams. Signed-off-by: Mark Farrugia --- dummy/dummy.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'dummy') diff --git a/dummy/dummy.c b/dummy/dummy.c index 7c85531..872ade9 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -240,17 +240,14 @@ static struct snd_pcm_ops dummyap_pcm_ops = { * Dummy Audio Path AVIRT registration ******************************************************************************/ static int dummy_configure(struct snd_card *card, - struct config_group *snd_avirt_stream_group, - unsigned int stream_count) + struct snd_avirt_stream_array *stream_array) { // Do something with streams + int idx = 0; + struct snd_avirt_stream *stream; - struct list_head *entry; - list_for_each (entry, &snd_avirt_stream_group->cg_children) { - struct config_item *item = - container_of(entry, struct config_item, ci_entry); - struct snd_avirt_stream *stream = - snd_avirt_stream_from_config_item(item); + for (idx = 0; idx < stream_array->count; idx++) { + stream = stream_array->streams[idx]; AP_INFOK("stream name:%s device:%d channels:%d", stream->name, stream->device, stream->channels); } -- cgit 1.2.3-korg