~diwic/pulseaudio/ubuntu.precise.jackdetection

« back to all changes in this revision

Viewing changes to debian/patches/0609-device-port-Add-a-property-list-to-ports.patch

  • Committer: David Henningsson
  • Date: 2012-01-09 17:04:39 UTC
  • Revision ID: david.henningsson@canonical.com-20120109170439-l1jj2v4vioo6hv2z
Replace jack detection patches with the ones from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 0ef3456f6836fa8d0083e5fb9d62e85c6edbc3aa Mon Sep 17 00:00:00 2001
 
2
From: David Henningsson <david.henningsson@canonical.com>
 
3
Date: Fri, 2 Dec 2011 13:34:54 +0100
 
4
Subject: [PATCH 609/609] device-port: Add a property list to ports.
 
5
 
 
6
They're not used for anything yet, but hopefully soon they'll be.
 
7
 
 
8
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
 
9
---
 
10
 src/pulsecore/cli-text.c    |    6 +++++-
 
11
 src/pulsecore/device-port.c |    3 +++
 
12
 src/pulsecore/device-port.h |    1 +
 
13
 3 files changed, 9 insertions(+), 1 deletions(-)
 
14
 
 
15
diff --git a/src/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
 
16
index 2253635..4823924 100644
 
17
--- a/src/pulsecore/cli-text.c
 
18
+++ b/src/pulsecore/cli-text.c
 
19
@@ -124,9 +124,13 @@ static void append_port_list(pa_strbuf *s, pa_hashmap *ports)
 
20
         return;
 
21
 
 
22
     pa_strbuf_puts(s, "\tports:\n");
 
23
-    PA_HASHMAP_FOREACH(p, ports, state)
 
24
+    PA_HASHMAP_FOREACH(p, ports, state) {
 
25
+        char *t = pa_proplist_to_string_sep(p->proplist, "\n\t\t\t\t");
 
26
         pa_strbuf_printf(s, "\t\t%s: %s (priority %u, available: %s)\n",
 
27
             p->name, p->description, p->priority, port_available_to_string(p->available));
 
28
+        pa_strbuf_printf(s, "\t\t\tproperties:\n\t\t\t\t%s\n", t);
 
29
+        pa_xfree(t);
 
30
+    }
 
31
 }
 
32
 
 
33
 char *pa_card_list_to_string(pa_core *c) {
 
34
diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
 
35
index 7988649..30fb025 100644
 
36
--- a/src/pulsecore/device-port.c
 
37
+++ b/src/pulsecore/device-port.c
 
38
@@ -70,6 +70,8 @@ static void device_port_free(pa_object *o) {
 
39
     pa_assert(p);
 
40
     pa_assert(pa_device_port_refcnt(p) == 0);
 
41
 
 
42
+    if (p->proplist)
 
43
+        pa_proplist_free(p->proplist);
 
44
     if (p->profiles)
 
45
         pa_hashmap_free(p->profiles, NULL, NULL);
 
46
     pa_xfree(p->name);
 
47
@@ -94,6 +96,7 @@ pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *des
 
48
     p->profiles = NULL;
 
49
     p->is_input = FALSE;
 
50
     p->is_output = FALSE;
 
51
+    p->proplist = pa_proplist_new();
 
52
 
 
53
     return p;
 
54
 }
 
55
diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
 
56
index ee4fc3e..4e90a62 100644
 
57
--- a/src/pulsecore/device-port.h
 
58
+++ b/src/pulsecore/device-port.h
 
59
@@ -47,6 +47,7 @@ struct pa_device_port {
 
60
     unsigned priority;
 
61
     pa_port_available_t available;         /* PA_PORT_AVAILABLE_UNKNOWN, PA_PORT_AVAILABLE_NO or PA_PORT_AVAILABLE_YES */
 
62
 
 
63
+    pa_proplist *proplist;
 
64
     pa_hashmap *profiles; /* Can be NULL. Does not own the profiles */
 
65
     pa_bool_t is_input:1;
 
66
     pa_bool_t is_output:1;
 
67
-- 
 
68
1.7.7.3
 
69