struct sink *sink = user_data;
int id, perr;
+ sink->connect_id = 0;
+
if (err) {
avdtp_unref(sink->session);
sink->session = NULL;
if (!sink->session)
return FALSE;
- if (avdtp_discover(sink->session, discovery_complete, sink) < 0)
+ sink->connect_id = a2dp_discover(sink->session, discovery_complete,
+ sink);
+ if (sink->connect_id == 0)
return FALSE;
return TRUE;
if (sink->connect_id > 0) {
a2dp_cancel(sink->connect_id);
sink->connect_id = 0;
- btd_service_connecting_complete(sink->service, -ECANCELED);
+ btd_service_disconnecting_complete(sink->service, 0);
avdtp_unref(sink->session);
sink->session = NULL;