Skip to content

Commit 820196d

Browse files
torokati44relrelb
authored andcommitted
audio: Handle AudioCompression::UncompressedUnknownEndian in AudioMixer::make_seekable_decoder()
The same way as it is done in decoders::make_decoder().
1 parent 6f35d90 commit 820196d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/backend/audio/mixer.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ impl AudioMixer {
193193
data: Cursor<ArcAsRef>,
194194
) -> Result<Box<dyn SeekableDecoder>, Error> {
195195
let decoder: Box<dyn SeekableDecoder> = match format.compression {
196+
AudioCompression::UncompressedUnknownEndian => {
197+
// Cross fingers that it's little endian.
198+
log::warn!("make_decoder: PCM sound is unknown endian; assuming little endian");
199+
Box::new(PcmDecoder::new(
200+
data,
201+
format.is_stereo,
202+
format.sample_rate,
203+
format.is_16_bit,
204+
))
205+
}
196206
AudioCompression::Uncompressed => Box::new(PcmDecoder::new(
197207
data,
198208
format.is_stereo,

0 commit comments

Comments
 (0)