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

Commit bee4965c authored by Misael Lopez Cruz's avatar Misael Lopez Cruz
Browse files

audio: Fix false positives in audio_is_remote_submix_device()



The audio_is_remote_submix_device() helper function incorrectly
reported AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES and
AUDIO_DEVICE_IN_LINE as a submix devices.

The cases where the confusion occurs are for devices whose bitwise
value only differs in the direction bit.

Change-Id: I3bb9fd1158a26a8f4b3b59246974e703ca5ba0f0
Signed-off-by: default avatarMisael Lopez Cruz <misael.lopez@ti.com>
parent 89114c50
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1102,8 +1102,10 @@ static inline bool audio_is_usb_device(audio_devices_t device)

static inline bool audio_is_remote_submix_device(audio_devices_t device)
{
    if ((device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX) == AUDIO_DEVICE_OUT_REMOTE_SUBMIX
            || (device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) == AUDIO_DEVICE_IN_REMOTE_SUBMIX)
    if ((audio_is_output_devices(device) &&
         (device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX) == AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
        || (!audio_is_output_devices(device) &&
         (device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) == AUDIO_DEVICE_IN_REMOTE_SUBMIX))
        return true;
    else
        return false;