From 511f5e91f17edc3520a6c83a3b9150c2b3db6a63 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 6 Aug 2024 18:08:14 +0200 Subject: [PATCH] mov: set block size when possible This seems to allow decoding of e.g. MS IMA ADPCM variant --- nihav-commonfmt/src/demuxers/mov.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/demuxers/mov.rs b/nihav-commonfmt/src/demuxers/mov.rs index a8d0dfd..aa84a20 100644 --- a/nihav-commonfmt/src/demuxers/mov.rs +++ b/nihav-commonfmt/src/demuxers/mov.rs @@ -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 -- 2.39.5