bluetooth: Implement get_n_used() for module-bluez5-device
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>
Tue, 24 Sep 2013 22:45:55 +0000 (19:45 -0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Sun, 29 Sep 2013 13:54:38 +0000 (16:54 +0300)
src/modules/bluetooth/module-bluez5-device.c

index 3214cae..36d7174 100644 (file)
@@ -1882,3 +1882,12 @@ void pa__done(pa_module *m) {
 
     pa_xfree(u);
 }
+
+int pa__get_n_used(pa_module *m) {
+    struct userdata *u;
+
+    pa_assert(m);
+    pa_assert_se(u = m->userdata);
+
+    return (u->sink ? pa_sink_linked_by(u->sink) : 0) + (u->source ? pa_source_linked_by(u->source) : 0);
+}