~ubuntu-branches/ubuntu/precise/pulseaudio/precise

« back to all changes in this revision

Viewing changes to debian/patches/0613-Add-a-new-module-switch-on-port-available-that-acts-.patch

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, David Henningsson
  • Date: 2012-02-17 07:28:23 UTC
  • Revision ID: package-import@ubuntu.com-20120217072823-4ps0d8io2iumrbh3
Tags: 1:1.1-0ubuntu8
[ David Henningsson ]
* Make sure we switch away from unavailable ports at 
  startup (LP: #928914)
* 0020-Fix-Darth-Vader-panning-bug.patch: 
  Fix distorted sound when panned hard left (or right). (LP: #928757)
* 0618-alsa-mixer-Don-t-use-dangling-pointers-as-port-hashm.patch:
  Fix inability to set port when options were used (LP: #932804)
* Minimize margins for deferred volumes, as a workaround for volume 
  changes being dropped on port change.
* 0610-Jack-detection-kcontrol-implementation.patch:
  Fix a bug in the headphone path

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From c03b5dc144cb491ccaf4596cc39d759006137b52 Mon Sep 17 00:00:00 2001
 
1
From 1f4e7121bbc577f275faf008800da820e12b7004 Mon Sep 17 00:00:00 2001
2
2
From: David Henningsson <david.henningsson@canonical.com>
3
3
Date: Mon, 5 Sep 2011 14:20:48 +0200
4
 
Subject: [PATCH 613/614] Add a new module switch-on-port-available that acts
5
 
 on port changes
 
4
Subject: [PATCH 2/6] Add a new module switch-on-port-available that acts on
 
5
 port changes
6
6
 
7
7
---
8
8
 src/Makefile.am                               |    6 +
9
 
 src/modules/module-switch-on-port-available.c |  199 +++++++++++++++++++++++++
10
 
 2 files changed, 205 insertions(+), 0 deletions(-)
 
9
 src/modules/module-switch-on-port-available.c |  217 +++++++++++++++++++++++++
 
10
 2 files changed, 223 insertions(+), 0 deletions(-)
11
11
 create mode 100644 src/modules/module-switch-on-port-available.c
12
12
 
13
13
diff --git a/src/Makefile.am b/src/Makefile.am
43
43
 module_filter_apply_la_LIBADD = $(MODULE_LIBADD)
44
44
diff --git a/src/modules/module-switch-on-port-available.c b/src/modules/module-switch-on-port-available.c
45
45
new file mode 100644
46
 
index 0000000..5b4a518
 
46
index 0000000..8ee3192
47
47
--- /dev/null
48
48
+++ b/src/modules/module-switch-on-port-available.c
49
 
@@ -0,0 +1,199 @@
 
49
@@ -0,0 +1,217 @@
50
50
+/***
51
51
+  This file is part of PulseAudio.
52
52
+
221
221
+    return PA_HOOK_OK;
222
222
+}
223
223
+
 
224
+static void handle_all_unavailable(pa_core *core) {
 
225
+    pa_card *card;
 
226
+    uint32_t state;
 
227
+
 
228
+    PA_IDXSET_FOREACH(card, core->cards, state) {
 
229
+        pa_device_port *port;
 
230
+        void *state2;
 
231
+        if (!card->ports)
 
232
+            continue;
 
233
+        PA_HASHMAP_FOREACH(port, card->ports, state2) {
 
234
+            if (port->available == PA_PORT_AVAILABLE_NO)
 
235
+                port_available_hook_callback(core, port, NULL);
 
236
+        }
 
237
+    }
 
238
+}
 
239
+
224
240
+int pa__init(pa_module*m) {
225
241
+    struct userdata *u;
226
242
+
230
246
+
231
247
+    u->callback_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_PORT_AVAILABLE_CHANGED], PA_HOOK_LATE, (pa_hook_cb_t) port_available_hook_callback, u);
232
248
+
 
249
+    handle_all_unavailable(m->core);
 
250
+
233
251
+    return 0;
234
252
+}
235
253
+
247
265
+    pa_xfree(u);
248
266
+}
249
267
-- 
250
 
1.7.7.3
 
268
1.7.9
251
269