Merge "hal: tear down a2dp path for non-offloaded streams when suspended"

This commit is contained in:
qctecmdr 2019-09-17 02:17:25 -07:00 committed by Gerrit - the friendly Code Review server
commit 640a31f881
1 changed files with 9 additions and 6 deletions

View File

@ -9598,11 +9598,10 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou
pthread_mutex_unlock(&out->compr_mute_lock);
}
} else {
if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
// mute compress stream if suspended
pthread_mutex_lock(&out->compr_mute_lock);
if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
(!out->a2dp_compress_mute)) {
if (!out->standby) {
if (!out->a2dp_compress_mute && !out->standby) {
ALOGD("%s: selecting speaker and muting stream", __func__);
devices = out->devices;
out->devices = AUDIO_DEVICE_OUT_SPEAKER;
@ -9619,8 +9618,12 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou
out->volume_l = left_p;
out->volume_r = right_p;
}
}
pthread_mutex_unlock(&out->compr_mute_lock);
} else {
// tear down a2dp path for non offloaded streams
if (audio_extn_a2dp_source_is_suspended())
out_standby_l(&out->stream.common);
}
}
ALOGV("%s: exit", __func__);
return 0;