]> code.delx.au - pulseaudio/commitdiff
bluetooth: Avoid duplicating profile argument twice
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 27 Jul 2012 14:41:22 +0000 (16:41 +0200)
committerTanu Kaskinen <tanuk@iki.fi>
Sat, 28 Jul 2012 12:55:44 +0000 (15:55 +0300)
The module module-bluetooth-device should never be given parameter
'profile' twice, even if both HFGW and A2DP are playing. This patch
proposed to consider HFGW first.

src/modules/bluetooth/module-bluetooth-discover.c

index e96a4f31c824bc0d03e9d91bb3d5350a7d618182..d4e056e3aee9032bd15e9a3ca0d7d5bb86117bfc 100644 (file)
@@ -107,11 +107,10 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const
                 args = tmp;
             }
 
-            if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
-                args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
-
             if (d->hfgw_state >= PA_BT_AUDIO_STATE_CONNECTED)
                 args = pa_sprintf_malloc("%s profile=\"hfgw\"", args);
+            else if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
+                args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
 
             pa_log_debug("Loading module-bluetooth-device %s", args);
             m = pa_module_load(u->module->core, "module-bluetooth-device", args);