From c3a264a57a6e61c22280b52dd01f2677600a04f2 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 25 Nov 2008 11:42:25 -0300 Subject: Fix headset_request_stream to check for stream locks. A stream should only be configured if there is no other application holding the lock. --- audio/headset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'audio/headset.c') 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); -- cgit