sink->cb_id = 0;
break;
case AVDTP_STATE_OPEN:
+ btd_service_connecting_complete(sink->service, 0);
sink_set_state(dev, SINK_STATE_CONNECTED);
break;
case AVDTP_STATE_STREAMING:
static gboolean stream_setup_retry(gpointer user_data)
{
struct sink *sink = user_data;
- int err;
sink->retry_id = 0;
- if (sink->stream_state >= AVDTP_STATE_OPEN) {
- DBG("Stream successfully created, after XCASE connect:connect");
- err = 0;
- } else {
+ if (sink->stream_state < AVDTP_STATE_OPEN) {
DBG("Stream setup failed, after XCASE connect:connect");
- err = -EIO;
+ btd_service_connecting_complete(sink->service, -EIO);
}
- btd_service_connecting_complete(sink->service, err);
-
if (sink->connect_id > 0) {
a2dp_cancel(sink->dev, sink->connect_id);
sink->connect_id = 0;
sink->connect_id = 0;
- if (stream) {
- DBG("Stream successfully created");
- btd_service_connecting_complete(sink->service, 0);
+ if (stream)
return;
- }
avdtp_unref(sink->session);
sink->session = NULL;