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

Commit 0a675dc7 authored by BeYkeRYkt's avatar BeYkeRYkt Committed by Bruno Martins
Browse files

hal: msm8974: Fix the wrong device for AUDIO_SOURCE_CAMCORDER

* The 4b084132 commit ("audio: select camcorder snd device according to camera
  orientation") adds the ability to configure microphones depending on the
  camera orientation, however, some code associated with 'snd_device' is written
  in the wrong place, since the subsequent code after them will still reassign
  'snd_device'. Fix this by moving the current code to the place
  SND_DEVICE_IN_CAMCORDER_MIC, as was originally intended in the original
  source.

Change-Id: Ief851c0f320d0acaa95fb5c33713d2e655194497
parent 4a36af45
Loading
Loading
Loading
Loading
+24 −25
Original line number Diff line number Diff line
@@ -7399,6 +7399,12 @@ snd_device_t platform_get_input_snd_device(void *platform,
    } else if (source == AUDIO_SOURCE_CAMCORDER) {
        if (compare_device_type(&in_devices, AUDIO_DEVICE_IN_BUILTIN_MIC) ||
            compare_device_type(&in_devices, AUDIO_DEVICE_IN_BACK_MIC)) {
            if (str_bitwidth == 16) {
                if ((my_data->fluence_type & FLUENCE_DUAL_MIC) &&
                    (my_data->source_mic_type & SOURCE_DUAL_MIC) &&
                    (channel_count == 2))
                    snd_device = SND_DEVICE_IN_HANDSET_DMIC_STEREO;
                else
                    switch (adev->camera_orientation) {
                        case CAMERA_BACK_LANDSCAPE:
                            snd_device = SND_DEVICE_IN_CAMCORDER_LANDSCAPE;
@@ -7423,13 +7429,6 @@ snd_device_t platform_get_input_snd_device(void *platform,
                            snd_device = SND_DEVICE_IN_CAMCORDER_LANDSCAPE;
                            break;
                    }
            if (str_bitwidth == 16) {
                if ((my_data->fluence_type & FLUENCE_DUAL_MIC) &&
                    (my_data->source_mic_type & SOURCE_DUAL_MIC) &&
                    (channel_count == 2))
                    snd_device = SND_DEVICE_IN_HANDSET_DMIC_STEREO;
                else
                    snd_device = SND_DEVICE_IN_CAMCORDER_MIC;
            }
            /*
             * for other bit widths