diff options
author | David Henningsson <david.henningsson@canonical.com> | 2014-03-28 11:59:09 +0100 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2014-11-14 10:52:08 +0100 |
commit | c75c1b548c973c4cdd518a6ff3939a0d538a2f6a (patch) | |
tree | abad65efda7565a5ce7f5d896fcafa6db360dcee | |
parent | 0a5adc95c46b7140e004fdd993181237f99c51d5 (diff) |
module-switch-on-port-available: Don't switch profiles on uninitialized cards
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 2c7ad17fe..c560306be 100644 --- a/src/modules/module-switch-on-port-available.c +++ b/src/modules/module-switch-on-port-available.c @@ -173,6 +173,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); |