diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-03-28 11:59:09 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2014-08-22 13:39:28 +0200 |
commit | 816ffa0ee84b412384a28940a479f4beecb16d62 (patch) | |
tree | 31e898b703ffc70f64d50cc413239f9b3762d69c | |
parent | a6d108d3bae9a2abd39e6e503d5354e34b4c69e1 (diff) |
module-switch-on-port-available: Don't switch profiles on uninitialized cardsrhel-7.1-work
This could cause the HDMI port to become the default on some systems
where analog output was available.
BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1256511
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=73375
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r-- | src/modules/module-switch-on-port-available.c | 5 |
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); |