diff --git a/libs/audio/renderer/wav.c b/libs/audio/renderer/wav.c index 0ee193fa2..1f94daf87 100644 --- a/libs/audio/renderer/wav.c +++ b/libs/audio/renderer/wav.c @@ -235,18 +235,18 @@ wav_get_info (QFile *file) Sys_Printf ("missing format chunk\n"); goto bail; } - if (!data) { - Sys_Printf ("missing data chunk\n"); - goto bail; - } if (dfmt->format_tag != 1) { - Sys_Printf ("not Microsfot PCM\n"); + Sys_Printf ("not Microsoft PCM\n"); goto bail; } if (dfmt->channels < 1 || dfmt->channels > 8) { Sys_Printf ("unsupported channel count\n"); goto bail; } + if (!data) { + Sys_Printf ("missing data chunk\n"); + goto bail; + } info.rate = dfmt->samples_per_sec; info.width = dfmt->bits_per_sample / 8; diff --git a/libs/util/riff.c b/libs/util/riff.c index 2e5ee7f95..eff201e13 100644 --- a/libs/util/riff.c +++ b/libs/util/riff.c @@ -367,6 +367,27 @@ riff_read (QFile *f) chunk = &data->ck; } break; + case RIFF_CASE ('w','a','v','l'): + // FIXME: Convert wavl to data ? + case RIFF_CASE ('s','l','n','t'): + // FIXME: Add silence to data + case RIFF_CASE ('l','i','s','t'): + case RIFF_CASE ('l','a','b','l'): + case RIFF_CASE ('n','o','t','e'): + case RIFF_CASE ('l','t','x','t'): + case RIFF_CASE ('p','l','s','t'): + case RIFF_CASE ('i','n','s','t'): + case RIFF_CASE ('f','a','c','t'): + case RIFF_CASE ('s','m','p','l'): + { // Unused chunk, still present in a lot of wav files. + int c; + + Qseek(f, ck.len, SEEK_CUR); + if ((c = Qgetc (f)) && c != -1) + Qungetc (f, c); + continue; // Skip those blocks. + } + break; default: // unknown chunk. bail (could be corrupted file) chunk = 0;