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

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

Merge "Audio: update stream volume if device route successful."

parents 2c47902d c2188fb0
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -8181,6 +8181,21 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
                adev->allow_afe_proxy_usage = true;
            }
        }
        if (audio_is_a2dp_out_device(device)) {
           struct audio_usecase *usecase;
           struct listnode *node;
           list_for_each(node, &adev->usecase_list) {
               usecase = node_to_item(node, struct audio_usecase, list);
               if (PCM_PLAYBACK == usecase->type && usecase->stream.out &&
                  (usecase->stream.out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
                   usecase->stream.out->a2dp_compress_mute) {
                   struct stream_out *out = usecase->stream.out;
                   ALOGD("Unmuting the stream when Bt-A2dp disconnected and stream is mute");
                   out->a2dp_compress_mute = false;
                   out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
               }
           }
        }
    }

    audio_extn_hfp_set_parameters(adev, parms);
@@ -9343,7 +9358,7 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou
            select_devices(adev, uc_info->id);
            pthread_mutex_lock(&out->compr_mute_lock);
            if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) &&
                (out->a2dp_compress_mute)) {
                (out->a2dp_compress_mute) && (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)) {
                out->a2dp_compress_mute = false;
                out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
            }