~ubuntu-audio-dev/pulseaudio/pulseaudio-5

« back to all changes in this revision

Viewing changes to debian/patches/0106-module-switch-on-port-available-Don-t-switch-profile.patch

  • Committer: Luke Yelavich
  • Date: 2014-07-29 05:42:10 UTC
  • mfrom: (609.1.20 ubuntu)
  • Revision ID: luke.yelavich@canonical.com-20140729054210-kw03phe22dk6jzfq
Merge latest pulseaudio packaging changes from trusty/utopic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From ef4a41e8b0ef81a53769d853dbc7679b25252327 Mon Sep 17 00:00:00 2001
 
2
From: David Henningsson <david.henningsson@canonical.com>
 
3
Date: Fri, 28 Mar 2014 11:59:09 +0100
 
4
Subject: [PATCH] module-switch-on-port-available: Don't switch profiles on
 
5
 uninitialized cards
 
6
 
 
7
This could cause the HDMI port to become the default on some systems
 
8
where analog output was available.
 
9
 
 
10
BugLink: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1256511
 
11
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=73375
 
12
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
 
13
---
 
14
 src/modules/module-switch-on-port-available.c | 5 +++++
 
15
 1 file changed, 5 insertions(+)
 
16
 
 
17
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
 
18
index 2c7ad17..c560306 100644
 
19
--- a/src/modules/module-switch-on-port-available.c
 
20
+++ b/src/modules/module-switch-on-port-available.c
 
21
@@ -173,6 +173,11 @@ static pa_hook_result_t port_available_hook_callback(pa_core *c, pa_device_port
 
22
         return PA_HOOK_OK;
 
23
     }
 
24
 
 
25
+    if (pa_idxset_size(card->sinks) == 0 && pa_idxset_size(card->sources) == 0)
 
26
+        /* This card is not initialized yet. We'll handle it in
 
27
+           sink_new / source_new callbacks later. */
 
28
+        return PA_HOOK_OK;
 
29
+
 
30
     find_sink_and_source(card, port, &sink, &source);
 
31
 
 
32
     is_active_profile = card->active_profile == pa_hashmap_get(port->profiles, card->active_profile->name);
 
33
-- 
 
34
1.9.1
 
35