]> code.delx.au - pulseaudio/commitdiff
device-port: Send a subscription event when the offset changes.
authorpoljar (Damir Jelić) <poljarinho@gmail.com>
Thu, 28 Jun 2012 11:17:21 +0000 (13:17 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Sat, 30 Jun 2012 10:49:29 +0000 (13:49 +0300)
When the offset changes a subscription event should be sent to the
relevant card.

src/pulsecore/device-port.c

index 28879f76d764b2871214adc3d9bd768811ddf658..9ea54e3d400d7dc1c346b784489169d1ca74d3de 100644 (file)
@@ -116,6 +116,8 @@ void pa_device_port_hashmap_free(pa_hashmap *h) {
 
 void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset) {
     uint32_t state;
+    pa_core *core;
+    pa_card *card;
 
     pa_assert(p);
 
@@ -139,4 +141,9 @@ void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset) {
                 break;
             }
     }
+
+    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);
 }