Skip to content

Commit

Permalink
i9500: simplify parameter routing
Browse files Browse the repository at this point in the history
* Don't make distinction between in-call/not in-call
* Use adev->out_device to decide whether to route
  • Loading branch information
intervigilium committed Aug 19, 2013
1 parent 2165c6a commit cb9e7a3
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions audio/audio_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cb9e7a3

Please sign in to comment.