Merge commit 'android-4.4.1_r1' into HEAD
* commit 'android-4.4.1_r1':
hal: Fix the audio loss issue on codec back end
hal: Fix for Audio Route issue when sound path changes
audio: fix output flag test in open_output_stream
Conflicts:
hal/audio_hw.c
Change-Id: Ib470b143c37ca7719757d20f37253cb256c26343
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index cd73094..a81a53a 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -390,6 +390,13 @@
enable_snd_device(adev, snd_device, false);
}
}
+
+ list_for_each(node, &adev->usecase_list) {
+ usecase = node_to_item(node, struct audio_usecase, list);
+ if (switch_device[usecase->id]) {
+ enable_snd_device(adev, snd_device, false);
+ }
+ }
/* Make sure new snd device is enabled before re-routing the streams */
audio_route_update_mixer(adev->audio_route);
@@ -1257,8 +1264,8 @@
}
pthread_mutex_lock(&out->lock);
- pthread_mutex_lock(&adev->lock);
if (!out->standby) {
+ pthread_mutex_lock(&adev->lock);
out->standby = true;
if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) {
if (out->pcm) {
@@ -1275,8 +1282,8 @@
}
}
stop_output_stream(out);
+ pthread_mutex_unlock(&adev->lock);
}
- pthread_mutex_unlock(&adev->lock);
pthread_mutex_unlock(&out->lock);
ALOGV("%s: exit", __func__);
return 0;
@@ -1782,12 +1789,12 @@
pthread_mutex_lock(&in->lock);
if (!in->standby) {
+ pthread_mutex_lock(&adev->lock);
in->standby = true;
if (in->pcm) {
pcm_close(in->pcm);
in->pcm = NULL;
}
- pthread_mutex_lock(&adev->lock);
status = stop_input_stream(in);
pthread_mutex_unlock(&adev->lock);
}