summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-16 19:14:31 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-16 19:14:31 +0000
commit8ae40e0b0046a011bbc15771f248d7950a606ae4 (patch)
treeb90cd418ac5ba1174ada72a2c2db8136240f6732 /audio/unix.c
parentbf48e6cc1e92a136070f70d880c17d221f410175 (diff)
Fix minumum bitpool calculation
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/audio/unix.c b/audio/unix.c
index 10856b93..0e5fd5c1 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -140,6 +140,30 @@ static service_type_t select_service(struct device *dev)
return TYPE_NONE;
}
+
+static void stream_state_changed(struct avdtp_stream *stream,
+ avdtp_state_t old_state,
+ avdtp_state_t new_state,
+ struct avdtp_error *err,
+ void *user_data)
+{
+ struct unix_client *client = user_data;
+
+ if (err)
+ return;
+
+ switch (new_state) {
+ case AVDTP_STATE_IDLE:
+ if (client->data.session) {
+ avdtp_unref(client->data.session);
+ client->data.session = NULL;
+ }
+ break;
+ default:
+ break;
+ }
+}
+
static void a2dp_setup_complete(struct avdtp *session, struct device *dev,
struct avdtp_stream *stream,
void *user_data)
@@ -223,11 +247,15 @@ static void a2dp_setup_complete(struct avdtp *session, struct device *dev,
unix_send_cfg(client->sock, cfg, fd);
+ avdtp_stream_add_cb(session, stream, stream_state_changed, dev);
+
return;
failed:
unix_send_cfg(client->sock, NULL, -1);
a2dp_source_unlock(dev, session);
+ avdtp_unref(client->data.session);
+ client->data.session = NULL;
}
static void cfg_event(struct unix_client *client, struct ipc_packet *pkt,