From 029b7d654aa89295cb3ff76e86b5b633c7c1f2f5 Mon Sep 17 00:00:00 2001 From: ashley Date: Sat, 19 Aug 2023 16:21:38 -0400 Subject: [PATCH] Fix for DMF 27 --- src/reskit/soundtrack/formats/dmf.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/reskit/soundtrack/formats/dmf.rs b/src/reskit/soundtrack/formats/dmf.rs index 3a9a771..a61537a 100644 --- a/src/reskit/soundtrack/formats/dmf.rs +++ b/src/reskit/soundtrack/formats/dmf.rs @@ -582,6 +582,11 @@ impl DmfModule { invalid => return Err( format!( "invalid file: invalid bitrate {}", invalid ) )? }; + + // Fast forward 8 bytes in the DMF stream + // (I have no idea what these fields are used for) + skip( bytes.by_ref(), 8 ); + let mut sample = Sample { name, rate, pitch, amp, bitrate, data: Vec::new() }; println!( "{}:\t{:?}", i, sample ); @@ -591,9 +596,6 @@ impl DmfModule { } samples.push( sample ); - - // Fast forward 8 bytes that are unused at the end of the sample - skip( bytes.by_ref(), 8 ); } Ok(