diff cdimage.c @ 2613:1fdf7acc5165

Fix handling of wave files with additional RIFF chunks before the data chunk
author Michael Pavone <pavone@retrodev.com>
date Sun, 16 Feb 2025 11:54:40 -0800
parents 69c28808b49a
children
line wrap: on
line diff
--- a/cdimage.c	Sat Feb 15 23:29:51 2025 -0800
+++ b/cdimage.c	Sun Feb 16 11:54:40 2025 -0800
@@ -340,7 +340,7 @@
 										if (wave.audio_format != 1 || wave.num_channels != 2 || wave.sample_rate != 44100 || wave.bits_per_sample != 16) {
 											warning("BlastEm only suports WAVE tracks in 16-bit stereo PCM format at 44100 hz, file %s does not match\n", fname);
 										}
-										extra_offset = wave.format_header.size + sizeof(wave.data_header) + sizeof(wave.chunk);
+										extra_offset = wave.data_offset;
 									} else {
 										fseek(f, 0, SEEK_SET);
 										flac = flac_file_from_file(f);