From cb9e7a305e15aa109ed204ab72053adf60cced0b Mon Sep 17 00:00:00 2001 From: Ethan Chen Date: Sun, 18 Aug 2013 17:27:11 -0700 Subject: [PATCH] i9500: simplify parameter routing * Don't make distinction between in-call/not in-call * Use adev->out_device to decide whether to route --- audio/audio_hw.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 81847485..ba037048 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -890,19 +890,20 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) val = atoi(value); pthread_mutex_lock(&adev->lock); pthread_mutex_lock(&out->lock); - /* In-call routing is done using adev->out_device and adev->input_source */ - if (adev->in_call) { - adev->out_device = val; - select_devices(adev); - if (adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO) - start_bt_sco(adev); - } else if (((out->device) != val) && (val != 0)) { - /* force output standby to start or stop SCO pcm stream if needed */ + if (((adev->out_device) != val) && (val != 0)) { + /* force output standby to stop SCO pcm stream if needed */ if ((val & AUDIO_DEVICE_OUT_ALL_SCO) ^ (out->device & AUDIO_DEVICE_OUT_ALL_SCO)) { do_out_standby(out); } + out->device = val; + adev->out_device = val; + select_devices(adev); + + /* start SCO stream if needed */ + if (val & AUDIO_DEVICE_OUT_ALL_SCO) + start_bt_sco(adev); } pthread_mutex_unlock(&out->lock); pthread_mutex_unlock(&adev->lock);