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

Commit fb85d5c8 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by android-build-merger
Browse files

Speaker channel swapping is conditional to audio mode am: f7148705

am: f5d48f09

Change-Id: Ic8e990e96547d6073c1dd4188c8c4d1cba0afb62
parents 81bddcc4 f5d48f09
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2755,6 +2755,14 @@ int platform_swap_lr_channels(struct audio_device *adev, bool swap_channels)
    struct platform_data *my_data = (struct platform_data *)adev->platform;

    if (my_data->speaker_lr_swap != swap_channels) {

        // do not swap channels in audio modes with concurrent capture and playback
        // as this may break the echo reference
        if ((adev->mode == AUDIO_MODE_IN_COMMUNICATION) || (adev->mode == AUDIO_MODE_IN_CALL)) {
            ALOGV("%s: will not swap due to audio mode %d", __func__, adev->mode);
            return 0;
        }

        my_data->speaker_lr_swap = swap_channels;

        list_for_each(node, &adev->usecase_list) {