diff options
author | Eric Laurent <elaurent@google.com> | 2014-09-03 11:41:27 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-09-03 11:41:27 -0700 |
commit | 39ace3da692ef1f05ed14b4a5f2dbd7538276119 (patch) | |
tree | 5168665d710f4a299d48e8deca000d860aab45ea /hal/audio_hw.c | |
parent | b9df188a8938144b72e11f6b57fab21ed2373c67 (diff) | |
download | hardware_qcom_audio-39ace3da692ef1f05ed14b4a5f2dbd7538276119.tar.gz hardware_qcom_audio-39ace3da692ef1f05ed14b4a5f2dbd7538276119.tar.bz2 hardware_qcom_audio-39ace3da692ef1f05ed14b4a5f2dbd7538276119.zip |
audio: stop call before changing playback path route
When an output stream receives a routing command after the
audio mode was changed back to normal, we must first stop the call
and then apply the new routing to playback path. If the playback
path is applied while still in call, the logic will not change
current call use case routing.
Bug: 17016230.
Change-Id: Icea84c017e492e6524dbd4431f8c2a4ef8828c72
Diffstat (limited to 'hal/audio_hw.c')
-rw-r--r-- | hal/audio_hw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 1bd34218..1fee1d33 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1324,6 +1324,13 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) * Because select_devices() must be called to switch back the music * playback to headset. */ + if ((adev->mode == AUDIO_MODE_NORMAL) && + voice_is_in_call(adev) && + output_drives_call(adev, out)) { + ret = voice_stop_call(adev); + adev->current_call_output = NULL; + } + if (val != 0) { out->devices = val; @@ -1344,13 +1351,6 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } } - if ((adev->mode == AUDIO_MODE_NORMAL) && - voice_is_in_call(adev) && - output_drives_call(adev, out)) { - ret = voice_stop_call(adev); - adev->current_call_output = NULL; - } - pthread_mutex_unlock(&adev->lock); pthread_mutex_unlock(&out->lock); } |