[pulseaudio-discuss] [PATCH 4/5] bluetooth: restore original sco_{sink, src}->set_volume when unloading

Tanu Kaskinen tanu.kaskinen at digia.com
Mon Mar 28 05:35:17 PDT 2011


From: Marc-André Lureau <marc-andre.lureau at nokia.com>

---
 src/modules/bluetooth/module-bluetooth-device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 455a53a..540d48c 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -121,7 +121,9 @@ struct a2dp_info {
 struct hsp_info {
     pcm_capabilities_t pcm_capabilities;
     pa_sink *sco_sink;
+    void (*sco_sink_set_volume)(pa_sink *s);
     pa_source *sco_source;
+    void (*sco_source_set_volume)(pa_source *s);
     pa_hook_slot *sink_state_changed_slot;
     pa_hook_slot *source_state_changed_slot;
 };
@@ -2804,12 +2806,14 @@ int pa__init(pa_module* m) {
     init_bt(u);
 
     if (u->hsp.sco_sink) {
+        u->hsp.sco_sink_set_volume = u->hsp.sco_sink->set_volume;
         k = pa_sprintf_malloc("bluetooth-device@%p", (void*) u->hsp.sco_sink);
         pa_shared_set(u->core, k, u);
         pa_xfree(k);
     }
 
     if (u->hsp.sco_source) {
+        u->hsp.sco_source_set_volume = u->hsp.sco_source->set_volume;
         k = pa_sprintf_malloc("bluetooth-device@%p", (void*) u->hsp.sco_source);
         pa_shared_set(u->core, k, u);
         pa_xfree(k);
@@ -2890,12 +2894,14 @@ void pa__done(pa_module *m) {
     shutdown_bt(u);
 
     if (u->hsp.sco_sink) {
+        u->hsp.sco_sink->set_volume = u->hsp.sco_sink_set_volume;
         k = pa_sprintf_malloc("bluetooth-device@%p", (void*) u->hsp.sco_sink);
         pa_shared_remove(u->core, k);
         pa_xfree(k);
     }
 
     if (u->hsp.sco_source) {
+        u->hsp.sco_source->set_volume = u->hsp.sco_source_set_volume;
         k = pa_sprintf_malloc("bluetooth-device@%p", (void*) u->hsp.sco_source);
         pa_shared_remove(u->core, k);
         pa_xfree(k);
-- 
1.7.4.1




More information about the pulseaudio-discuss mailing list