Diff between f11e50810b3a61ec09ec7b8dab63bb90c92e2eae and c618d0fa66b892a6f516be6f8a9be792a69c3265

Changed Files

File Additions Deletions Status
android/a2dp.c +4 -5 modified

Full Patch

diff --git a/android/a2dp.c b/android/a2dp.c
index 452fdab..e65e5a3 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -541,14 +541,12 @@ static void signaling_connect_cb(GIOChannel *chan, GError *err,
 
 	avdtp_add_disconnect_cb(dev->session, disconnect_cb, dev);
 
+	/* Proceed to stream setup if initiator */
 	if (dev->io) {
+		int perr;
+
 		g_io_channel_unref(dev->io);
 		dev->io = NULL;
-	}
-
-	/* Proceed to stream setup if initiator */
-	if (dev->state == HAL_A2DP_STATE_CONNECTING) {
-		int perr;
 
 		perr = avdtp_discover(dev->session, discover_cb, dev);
 		if (perr < 0) {
@@ -739,6 +737,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 	}
 
 	dev = a2dp_device_new(&dst);
+	bt_a2dp_notify_state(dev, HAL_A2DP_STATE_CONNECTING);
 	signaling_connect_cb(chan, err, dev);
 }