Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf8c1ee4 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents d7471fe6 28023002
Loading
Loading
Loading
Loading
+9 −6
Original line number Original line Diff line number Diff line
@@ -9506,11 +9506,10 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou
            pthread_mutex_unlock(&out->compr_mute_lock);
            pthread_mutex_unlock(&out->compr_mute_lock);
        }
        }
    } else {
    } else {
        if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
            // mute compress stream if suspended
            // mute compress stream if suspended
            pthread_mutex_lock(&out->compr_mute_lock);
            pthread_mutex_lock(&out->compr_mute_lock);
        if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
            if (!out->a2dp_compress_mute && !out->standby) {
            (!out->a2dp_compress_mute)) {
            if (!out->standby) {
                ALOGD("%s: selecting speaker and muting stream", __func__);
                ALOGD("%s: selecting speaker and muting stream", __func__);
                devices = out->devices;
                devices = out->devices;
                out->devices = AUDIO_DEVICE_OUT_SPEAKER;
                out->devices = AUDIO_DEVICE_OUT_SPEAKER;
@@ -9527,8 +9526,12 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou
                out->volume_l = left_p;
                out->volume_l = left_p;
                out->volume_r = right_p;
                out->volume_r = right_p;
            }
            }
        }
            pthread_mutex_unlock(&out->compr_mute_lock);
            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__);
    ALOGV("%s: exit", __func__);
    return 0;
    return 0;