[pulseaudio-discuss] [PATCH 1/2] device-port: Send a subscription event when the offset changes.

poljar (Damir Jelić) poljarinho at gmail.com
Thu Jun 28 04:17:21 PDT 2012


From: "poljar (Damir Jelić)" <poljarinho at gmail.com>

When the offset changes a subscription event should be sent to the
relevant card.
---
 src/pulsecore/device-port.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/pulsecore/device-port.c b/src/pulsecore/device-port.c
index 46e37e2..f39fc33 100644
--- a/src/pulsecore/device-port.c
+++ b/src/pulsecore/device-port.c
@@ -116,6 +116,8 @@ void pa_device_port_hashmap_free(pa_hashmap *h) {
 
 void pa_device_port_set_latency_offset(pa_device_port *p, pa_usec_t offset) {
     uint32_t state;
+    pa_core *core;
+    pa_card *card;
 
     pa_assert(p);
 
@@ -139,4 +141,10 @@ void pa_device_port_set_latency_offset(pa_device_port *p, pa_usec_t offset) {
                 break;
             }
     }
+
+    /* Post subscriptions to the card which owns us */
+    pa_assert_se(core = p->core);
+    PA_IDXSET_FOREACH(card, core->cards, state)
+        if (p == pa_hashmap_get(card->ports, p->name))
+            pa_subscription_post(core, PA_SUBSCRIPTION_EVENT_CARD|PA_SUBSCRIPTION_EVENT_CHANGE, card->index);
 }
-- 
1.7.11.1



More information about the pulseaudio-discuss mailing list