diff options
Diffstat (limited to 'audio/unix.c')
-rw-r--r-- | audio/unix.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/audio/unix.c b/audio/unix.c index ad311811..e30a2257 100644 --- a/audio/unix.c +++ b/audio/unix.c @@ -314,6 +314,13 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data) goto failed; } + client->data_fd = headset_get_sco_fd(dev); + if (client->data_fd < 0) { + error("Unable to get a SCO fd"); + headset_unlock(client->dev, hs->lock); + goto failed; + } + memset(buf, 0, sizeof(buf)); rsp->h.type = BT_RESPONSE; rsp->h.name = BT_START_STREAM; @@ -328,8 +335,6 @@ static void headset_resume_complete(struct audio_device *dev, void *user_data) unix_ipc_sendmsg(client, &ind->h); - client->data_fd = headset_get_sco_fd(dev); - if (unix_sendmsg_fd(client->sock, client->data_fd) < 0) { error("unix_sendmsg_fd: %s(%d)", strerror(errno), errno); headset_unlock(client->dev, hs->lock); |