Commit 34e91850 authored by Max Kellermann's avatar Max Kellermann

decoder/pcm: assume that audio/L16 is big-endian

parent 3a212412
......@@ -22,6 +22,7 @@
#include "../DecoderAPI.hxx"
#include "CheckAudioFormat.hxx"
#include "input/InputStream.hxx"
#include "system/ByteOrder.hxx"
#include "util/Error.hxx"
#include "util/ByteReverse.hxx"
#include "util/NumberParser.hxx"
......@@ -40,8 +41,6 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
};
const char *const mime = is.GetMimeType();
const bool reverse_endian = mime != nullptr &&
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0;
const bool l16 = mime != nullptr &&
GetMimeTypeBase(mime) == "audio/L16";
......@@ -52,6 +51,10 @@ pcm_stream_decode(Decoder &decoder, InputStream &is)
audio_format.channels = 1;
}
const bool reverse_endian = (l16 && IsLittleEndian()) ||
(mime != nullptr &&
strcmp(mime, "audio/x-mpd-cdda-pcm-reverse") == 0);
if (is_float)
audio_format.format = SampleFormat::FLOAT;
......
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