summaryrefslogtreecommitdiffstats
path: root/plugins/lib/bluetooth/hal-bt.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/lib/bluetooth/hal-bt.c')
-rw-r--r--plugins/lib/bluetooth/hal-bt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/lib/bluetooth/hal-bt.c b/plugins/lib/bluetooth/hal-bt.c
index 0f49311..8caee5b 100644
--- a/plugins/lib/bluetooth/hal-bt.c
+++ b/plugins/lib/bluetooth/hal-bt.c
@@ -213,12 +213,15 @@ CTLP_CAPI(events, source, argsJ, queryJ)
return -1;
}
- if(localHalBtPluginData.selectedBtDevice && localHalBtPluginData.selectedBtDevice != previouslySelectedBtDevice)
+ if(localHalBtPluginData.selectedBtDevice == previouslySelectedBtDevice) {
+ AFB_ApiDebug(source->api, "Bluetooth event received but device didn't change");
+ return 0;
+ }
+
+ if(localHalBtPluginData.selectedBtDevice)
localHalBtPluginData.btStreamEnabled = 1;
- else if (! localHalBtPluginData.selectedBtDevice)
- localHalBtPluginData.btStreamEnabled = 0;
else
- return 0;
+ localHalBtPluginData.btStreamEnabled = 0;
if(HalBtMixerLinkSetBtStreamingSettings(source->api,
localHalBtPluginData.currentHalData->ctlHalSpecificData->mixerApiName,
@@ -232,5 +235,5 @@ CTLP_CAPI(events, source, argsJ, queryJ)
return -2;
}
- return 1;
-}
+ return 0;
+} \ No newline at end of file