diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-11-26 20:08:40 +0200 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-11-26 20:08:40 +0200 | 
| commit | 7fa0fd3049a4034fc347d7035d56ca1682a24856 (patch) | |
| tree | e9f50081b7c30af0880bf8e381c02ecff6207f75 /audio/headset.c | |
| parent | b892677f0ba83e28daf6c05561295c1145d1c59f (diff) | |
| parent | 09d691ffa7e3d873c140aa05a4c2d6c888e1d769 (diff) | |
Merge branch 'for-upstream' of git://gitorious.org/bluez/vudentzs-clone into vudentz
Diffstat (limited to 'audio/headset.c')
| -rw-r--r-- | audio/headset.c | 33 | 
1 files changed, 27 insertions, 6 deletions
| diff --git a/audio/headset.c b/audio/headset.c index a7a0a969..be07e424 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -2124,7 +2124,8 @@ unsigned int headset_request_stream(struct audio_device *dev,  		hs->dc_timer = 0;  	} -	if (hs->state == HEADSET_STATE_CONNECT_IN_PROGRESS) +	if (hs->state == HEADSET_STATE_CONNECT_IN_PROGRESS || +			hs->state == HEADSET_STATE_PLAY_IN_PROGRESS)  		return connect_cb_new(hs, HEADSET_STATE_PLAYING, cb, user_data);  	if (hs->rfcomm == NULL) { @@ -2141,7 +2142,7 @@ unsigned int headset_request_stream(struct audio_device *dev,  	return id;  } -unsigned int headset_suspend_stream(struct audio_device *dev, +unsigned int headset_config_stream(struct audio_device *dev,  					headset_stream_cb_t cb,  					headset_lock_t lock,  					void *user_data) @@ -2161,10 +2162,7 @@ unsigned int headset_suspend_stream(struct audio_device *dev,  		return connect_cb_new(hs, HEADSET_STATE_CONNECTED, cb,  					user_data); -	if (hs->sco) { -		close_sco(dev); -		goto done; -	} else if (hs->rfcomm) +	if (hs->rfcomm)  		goto done;  	if (rfcomm_connect(dev, cb, user_data, &id) < 0) @@ -2181,6 +2179,29 @@ done:  	return id;  } +unsigned int headset_suspend_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 || !hs->rfcomm || !hs->sco) +		return 0; + +	if (hs->dc_timer) { +		g_source_remove(hs->dc_timer); +		hs->dc_timer = 0; +	} + +	close_sco(dev); + +	id = connect_cb_new(hs, HEADSET_STATE_CONNECTED, cb, user_data); +	g_idle_add((GSourceFunc) dummy_connect_complete, dev); +	return id; +} +  gboolean get_hfp_active(struct audio_device *dev)  {  	struct headset *hs = dev->headset; | 
