summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-19 15:27:56 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-19 15:27:56 +0000
commit78a94059160d7478624cad315022255f7ebbbe80 (patch)
tree0540f729abd73d2353ae716da22abcdf73709fec /audio/unix.c
parenta20ed567f6904e0dbf63aac5b45aa1fdd50f45de (diff)
Improve handling of unix clients which stay connected even though the headset connection is lost
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/audio/unix.c b/audio/unix.c
index 94c84500..f8832c91 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -164,6 +164,8 @@ static void stream_state_changed(struct avdtp_stream *stream,
switch (new_state) {
case AVDTP_STATE_IDLE:
+ a2dp_source_unlock(client->dev, a2dp->session);
+ client->dev = NULL;
if (a2dp->session) {
avdtp_unref(a2dp->session);
a2dp->session = NULL;
@@ -315,6 +317,7 @@ proceed:
client);
if (id == 0) {
error("request_stream failed");
+ a2dp_source_unlock(dev, a2dp->session);
goto failed;
}
@@ -395,6 +398,8 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
if (cond & (G_IO_HUP | G_IO_ERR)) {
debug("Unix client disconnected");
+ if (!client->dev)
+ goto failed;
if (client->disconnect)
client->disconnect(client->dev, cb_data);
if (client->type == TYPE_SINK && client->req_id > 0)