]> git.nihav.org Git - nihav.git/commitdiff
mov: set block size when possible
authorKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 6 Aug 2024 16:08:14 +0000 (18:08 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Tue, 6 Aug 2024 16:08:14 +0000 (18:08 +0200)
This seems to allow decoding of e.g. MS IMA ADPCM variant

nihav-commonfmt/src/demuxers/mov.rs

index a8d0dfd91787e098eba2402814c2ce056434ae85..aa84a20b38cd26c0bdc176fba4557ee28715eee5 100644 (file)
@@ -723,7 +723,7 @@ fn read_stsd(track: &mut Track, br: &mut ByteReader, size: u64) -> DemuxerResult
             if &fcc == b"raw " && sample_size == 8 {
                 soniton.signed = false;
             }
-            let block_align = 1;
+            let mut block_align = 1;
             match sver {
                 1 => {
                     let samples_per_packet  = br.read_u32be()?;
@@ -733,6 +733,7 @@ fn read_stsd(track: &mut Track, br: &mut ByteReader, size: u64) -> DemuxerResult
                     track.bsize = bytes_per_frame as usize;
                     track.frame_samples = samples_per_packet as usize;
                     track.tb_num = samples_per_packet;
+                    block_align = bytes_per_frame as usize;
                 },
                 2 => {
                                               br.read_u32be()?; // some size