diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 11:42:25 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2008-11-25 11:42:25 -0300 |
commit | c3a264a57a6e61c22280b52dd01f2677600a04f2 (patch) | |
tree | 0ee2658bfd373798003568d9b3f6fdbcefa0ef1b /audio/headset.c | |
parent | 0b6b1da0dd654d32873aacf81791c58316b377e3 (diff) |
Fix headset_request_stream to check for stream locks.
A stream should only be configured if there is no other application
holding the lock.
Diffstat (limited to 'audio/headset.c')
-rw-r--r-- | audio/headset.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c index 3600e269..75affd37 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -2105,12 +2105,17 @@ static gboolean dummy_connect_complete(struct audio_device *dev) return FALSE; } -unsigned int headset_request_stream(struct audio_device *dev, headset_stream_cb_t cb, +unsigned int headset_request_stream(struct audio_device *dev, + headset_stream_cb_t cb, + headset_lock_t lock, void *user_data) { struct headset *hs = dev->headset; unsigned int id; + if (hs->lock & lock) + return 0; + if (hs->rfcomm && hs->sco) { id = connect_cb_new(hs, HEADSET_STATE_PLAYING, cb, user_data); g_idle_add((GSourceFunc) dummy_connect_complete, dev); |