diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 16:11:24 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 16:11:24 -0300 |
commit | c6ca785eb241e6e93bcc6ef1ef430cf09ae362b3 (patch) | |
tree | 666c45cfd8e2ad75aa1309e26242b3163f9fcd6e /audio/unix.c | |
parent | c3a264a57a6e61c22280b52dd01f2677600a04f2 (diff) | |
download | bluez-c6ca785eb241e6e93bcc6ef1ef430cf09ae362b3.tar.gz |
Make hfp/hsp to suspend properly.
Diffstat (limited to 'audio/unix.c')
-rw-r--r-- | audio/unix.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/audio/unix.c b/audio/unix.c index e40aa418..ea5e3b8a 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -320,6 +320,28 @@ failed: client->dev = NULL; } +static void headset_suspend_complete(struct audio_device *dev, void *user_data) +{ + struct unix_client *client = user_data; + char buf[BT_AUDIO_IPC_PACKET_SIZE]; + struct bt_streamstart_rsp *rsp = (void *) buf; + + if (!dev) + goto failed; + + memset(buf, 0, sizeof(buf)); + rsp->rsp_h.msg_h.msg_type = BT_STREAMSTOP_RSP; + rsp->rsp_h.posix_errno = 0; + unix_ipc_sendmsg(client, &rsp->rsp_h.msg_h); + + return; + +failed: + error("suspend failed"); + unix_ipc_error(client, BT_STREAMSTOP_RSP, EIO); + client->dev = NULL; +} + static void a2dp_discovery_complete(struct avdtp *session, GSList *seps, struct avdtp_error *err, void *user_data) @@ -735,7 +757,7 @@ static void start_suspend(struct audio_device *dev, struct unix_client *client) case TYPE_HEADSET: hs = &client->d.hs; - id = headset_request_stream(dev, headset_setup_complete, + id = headset_suspend_stream(dev, headset_suspend_complete, hs->lock, client); client->cancel = headset_cancel_stream; break; |