summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/module-switch-on-port-available.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
index 1da612d56..203224b71 100644
--- a/src/modules/module-switch-on-port-available.c
+++ b/src/modules/module-switch-on-port-available.c
@@ -150,6 +150,11 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port
return PA_HOOK_OK;
}
+ if (pa_idxset_size(card->sinks) == 0 && pa_idxset_size(card->sources) == 0)
+ /* This card is not initialized yet. We'll handle it in
+ sink_new / source_new callbacks later. */
+ return PA_HOOK_OK;
+
find_sink_and_source(card, port, &sink, &source);
is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);