From e5d3fef58177a87f67cfbe31a65df7a34f13b83b Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 23 Oct 2020 12:11:58 +0200 Subject: [PATCH] mov: adjust signedness for certain kinds of audio --- nihav-commonfmt/src/demuxers/mov.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index b271b95..5a0e4f9 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -592,8 +592,10 @@ fn read_stsd(track: &mut Track, br: &mut ByteReader, size: u64) -> DemuxerResult } else { "unknown" }; -//todo adjust format for various PCM kinds - let soniton = NASoniton::new(sample_size as u8, SONITON_FLAG_SIGNED | SONITON_FLAG_BE); + let mut soniton = NASoniton::new(sample_size as u8, SONITON_FLAG_SIGNED | SONITON_FLAG_BE); + if &fcc == b"raw " && sample_size == 8 { + soniton.signed = false; + } let block_align = 1; if sver == 1 { let samples_per_packet = br.read_u32be()?; -- 2.39.5