Commit 9da5343f authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud

test: write little endian wav file for decoder

RIFF identifier supposes little endian data.

Change-Id: I56aa829c49388daf04f0249151ca7ef3e35416f4
parent 042b28e7
......@@ -113,21 +113,9 @@ MediaDecoderTest::testAudioFile()
template<typename Word>
static std::ostream& write(std::ostream& os, Word value, unsigned size)
{
union {
uint32_t i;
char c[4];
} big = {0x01020304};
// big endian if 0x01 is the first byte
if (big.c[0] == 1) {
while (size)
os.put(static_cast<char>((value >> (8 * --size)) & 0xFF));
return os;
} else {
for (; size; --size, value >>= 8)
os.put(static_cast<char>(value & 0xFF));
return os;
}
for (; size; --size, value >>= 8)
os.put(static_cast<char>(value & 0xFF));
return os;
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment