diff --git a/audio/avdtp.c b/audio/avdtp.c
index 041abc3..ffc3f70 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
avdtp_session_state_t state;
- /* True if the session should be automatically disconnected */
- gboolean auto_dc;
-
/* True if the entire device is being disconnected */
gboolean device_disconnect;
g_free(stream);
}
-static gboolean stream_timeout(gpointer user_data)
-{
- struct avdtp_stream *stream = user_data;
- struct avdtp *session = stream->session;
-
- if (avdtp_close(session, stream, FALSE) < 0)
- error("stream_timeout: closing AVDTP stream failed");
-
- stream->idle_timer = 0;
-
- return FALSE;
-}
-
static gboolean transport_cb(GIOChannel *chan, GIOCondition cond,
gpointer data)
{
break;
case AVDTP_STATE_OPEN:
stream->starting = FALSE;
- if ((old_state > AVDTP_STATE_OPEN && session->auto_dc) ||
- stream->open_acp)
- stream->idle_timer = g_timeout_add_seconds(STREAM_TIMEOUT,
- stream_timeout,
- stream);
break;
case AVDTP_STATE_STREAMING:
if (stream->idle_timer) {
if (session->dc_timer)
remove_disconnect_timer(session);
- session->auto_dc = TRUE;
-
if (session->ref != 1)
error("connection_lost: ref count not 1 after all callbacks");
else
/* We don't use avdtp_set_state() here since this isn't a state change
* but just setting of the initial state */
session->state = AVDTP_SESSION_STATE_DISCONNECTED;
- session->auto_dc = TRUE;
session->version = get_version(session);
(GIOFunc) session_cb, session,
NULL);
- if (session->stream_setup) {
+ if (session->stream_setup)
set_disconnect_timer(session);
- avdtp_set_auto_disconnect(session, FALSE);
- }
} else if (session->pending_open)
handle_transport_connect(session, chan, session->imtu,
session->omtu);
return g_slist_find(session->streams, stream) ? TRUE : FALSE;
}
-void avdtp_set_auto_disconnect(struct avdtp *session, gboolean auto_dc)
-{
- session->auto_dc = auto_dc;
-}
-
gboolean avdtp_stream_setup_active(struct avdtp *session)
{
return session->stream_setup;
diff --git a/audio/avdtp.h b/audio/avdtp.h
index dac093b..e294ded 100644
--- a/audio/avdtp.h
+++ b/audio/avdtp.h
void avdtp_get_peers(struct avdtp *session, bdaddr_t *src, bdaddr_t *dst);
-void avdtp_set_auto_disconnect(struct avdtp *session, gboolean auto_dc);
gboolean avdtp_stream_setup_active(struct avdtp *session);
void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc);
diff --git a/audio/sink.c b/audio/sink.c
index 6b21e47..8ba4e2a 100644
--- a/audio/sink.c
+++ b/audio/sink.c
if (!sink->session)
return FALSE;
- avdtp_set_auto_disconnect(sink->session, FALSE);
-
if (avdtp_discover(sink->session, discovery_complete, sink) < 0)
return FALSE;
diff --git a/audio/source.c b/audio/source.c
index dbba5b9..a5fa859 100644
--- a/audio/source.c
+++ b/audio/source.c
if (!source->session)
return FALSE;
- avdtp_set_auto_disconnect(source->session, FALSE);
-
if (avdtp_discover(source->session, discovery_complete, source) < 0)
return FALSE;