mov: adjust signedness for certain kinds of audio
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 23 Oct 2020 10:11:58 +0000 (12:11 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 23 Oct 2020 10:11:58 +0000 (12:11 +0200)
nihav-commonfmt/src/demuxers/mov.rs

index b271b95e3e777d4b4b31676c30d08293e1865118..5a0e4f9c374733a4968c9318cbfc5a3c9022e20d 100644 (file)
@@ -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()?;