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

Commit 760f8a66 authored by Vikram Panduranga's avatar Vikram Panduranga
Browse files

hal: remove sending apply audio path for speaker swap

For speaker swap channels, apply audio path  need not be
sent when swap is not requested or device switch is not
needed. Sending apply audio path will increment the ref
count in audio route which can lead to erroneous condition.

Change-Id: I64e3a867cd749c56d3432f1443f2cc4a92894374
parent 97e8f8f6
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -11062,7 +11062,6 @@ int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels)
{
    const char *mixer_ctl_name = "Swap channel";
    struct mixer_ctl *ctl;
    const char *mixer_path;
    struct platform_data *my_data = (struct platform_data *)adev->platform;

    // forced to set to swap, but device not rotated ... ignore set
@@ -11071,14 +11070,6 @@ int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels)

    ALOGV("%s:", __func__);

    if (swap_channels) {
        mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER_REVERSE);
        audio_route_apply_and_update_path(adev->audio_route, mixer_path);
    } else {
        mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER);
        audio_route_apply_and_update_path(adev->audio_route, mixer_path);
    }

    ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
    if (!ctl) {
        ALOGE("%s: Could not get ctl for mixer cmd - %s",__func__, mixer_ctl_name);