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

Commit 58748539 authored by Viraj Karandikar's avatar Viraj Karandikar Committed by android-build-merger
Browse files

Merge "WAVExtractor: support ambisonic subformat" am: 5d7e276b am: c1cf4c1b

am: d15df506

Change-Id: Id87034db774ea2c93d33d8f44a4a85e307b5a36c
parents e7e8d636 d15df506
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ enum {
};

static const char* WAVEEXT_SUBFORMAT = "\x00\x00\x00\x00\x10\x00\x80\x00\x00\xAA\x00\x38\x9B\x71";

static const char* AMBISONIC_SUBFORMAT = "\x00\x00\x21\x07\xD3\x11\x86\x44\xC8\xC1\xCA\x00\x00\x00";

static uint32_t U32_LE_AT(const uint8_t *ptr) {
    return ptr[3] << 24 | ptr[2] << 16 | ptr[1] << 8 | ptr[0];
@@ -250,7 +250,8 @@ status_t WAVExtractor::init() {
                // In a WAVE_EXT header, the first two bytes of the GUID stored at byte 24 contain
                // the sample format, using the same definitions as a regular WAV header
                mWaveFormat = U16_LE_AT(&formatSpec[24]);
                if (memcmp(&formatSpec[26], WAVEEXT_SUBFORMAT, 14)) {
                if (memcmp(&formatSpec[26], WAVEEXT_SUBFORMAT, 14) &&
                    memcmp(&formatSpec[26], AMBISONIC_SUBFORMAT, 14)) {
                    ALOGE("unsupported GUID");
                    return ERROR_UNSUPPORTED;
                }