Merge "WAVExtractor: support ambisonic subformat" am: 5d7e276b21
am: c1cf4c1b51

Change-Id: I48173d3dad4d55e780502ec5a90ebca85794e599
diff --git a/media/libstagefright/WAVExtractor.cpp b/media/libstagefright/WAVExtractor.cpp
index 1f04fa0..780b746 100644
--- a/media/libstagefright/WAVExtractor.cpp
+++ b/media/libstagefright/WAVExtractor.cpp
@@ -45,7 +45,7 @@
 };
 
 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 @@
                 // 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;
                 }