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

Commit b1c34f6d authored by Thomas Wendt's avatar Thomas Wendt Committed by Steve Kondik
Browse files

Fix audio recording for ICS audio blobs

This fixes audio recording when ICS_AUDIO_BLOB is set because
AUDIO_DEVICE_BIT_IN was not used with ICS. Add #ifdefs to use the old checks
again.

Change-Id: I33b37e74d33fed7ab0bc2af9907e07d799b0ec0e
parent d4188e0a
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -523,26 +523,41 @@ typedef enum {

static inline bool audio_is_output_device(audio_devices_t device)
{
#ifdef ICS_AUDIO_BLOB
    if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0))
#else
    if (((device & AUDIO_DEVICE_BIT_IN) == 0) &&
            (popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0))
#endif
        return true;

    else
        return false;

}

static inline bool audio_is_input_device(audio_devices_t device)
{
#ifdef ICS_AUDIO_BLOB
    if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) {
#else
    if ((device & AUDIO_DEVICE_BIT_IN) != 0) {
        device &= ~AUDIO_DEVICE_BIT_IN;
        if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0))
#endif
            return true;
    }
    return false;

}

static inline bool audio_is_output_devices(audio_devices_t device)
{
#ifdef ICS_AUDIO_BLOB
    return (device & ~AUDIO_DEVICE_OUT_ALL) == 0;
#else
    return (device & AUDIO_DEVICE_BIT_IN) == 0;
#endif
}