summaryrefslogtreecommitdiffstats
path: root/core.c
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-09 09:19:12 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-09 09:19:12 +1100
commitbd186ee6b13b7eb7b41f8d0fe0f78abd177a12a8 (patch)
treec6666c4cf75cf5ecf5b772875f3cb773c53276db /core.c
parent26fd635bbae7fbf5f139830fca84b58d4bddec3a (diff)
Only call 'configure' cb if there are streams for Audio Pathflounder_6.0.2flounder/6.0.26.0.2
We only want to call the Audio Path 'configure' callback when there is at least 1 stream mapped to that Audio Path. Change the return of snd_avirt_streams_get to return the number of mapped streams for a given Audio Path. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core.c')
-rw-r--r--core.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core.c b/core.c
index 6698a9e..a99f82a 100644
--- a/core.c
+++ b/core.c
@@ -271,7 +271,7 @@ static int snd_avirt_streams_get(const char *map,
}
}
- return 0;
+ return stream_array->count;
}
/**
@@ -322,8 +322,8 @@ int snd_avirt_audiopath_register(struct snd_avirt_audiopath *audiopath)
// If we have already sealed the streams, configure this AP
if (core.streams_sealed) {
stream_array.count = 0;
- snd_avirt_streams_get(audiopath->uid, &stream_array);
- audiopath->configure(core.card, &stream_array);
+ if (snd_avirt_streams_get(audiopath->uid, &stream_array) > 0)
+ audiopath->configure(core.card, &stream_array);
}
return 0;
@@ -420,8 +420,8 @@ int snd_avirt_streams_seal(void)
for (i = 0; i < MAX_STREAMS; i++)
stream_array.streams[i] = NULL;
stream_array.count = 0;
- snd_avirt_streams_get(ap_obj->path->uid, &stream_array);
- ap_obj->path->configure(core.card, &stream_array);
+ if (snd_avirt_streams_get(ap_obj->path->uid, &stream_array) > 0)
+ ap_obj->path->configure(core.card, &stream_array);
}
err = snd_card_register(core.card);