From 85d97fac9a1c50fc031c3fd8dfb454dedca48a11 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 17 Jan 2011 13:54:17 -0700 Subject: [PATCH] fix bugs in last commit --- Quake/snd_codec_wav.c | 4 ++-- Quake/snd_mem.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Quake/snd_codec_wav.c b/Quake/snd_codec_wav.c index 387d8e2e..4282f1ed 100644 --- a/Quake/snd_codec_wav.c +++ b/Quake/snd_codec_wav.c @@ -241,7 +241,7 @@ void *S_WAV_CodecLoad(const char *filename, snd_info_t *info) { int file; void *buffer; - + // Try to open the file COM_OpenFile(filename, &file); if(file == -1) @@ -294,7 +294,7 @@ snd_stream_t *S_WAV_CodecOpenStream(const char *filename) return NULL; // Read the RIFF header - if(!S_ReadRIFFHeader(rv->file, &rv->info)) + if(!S_ReadRIFFHeader(rv->file, filename, &rv->info)) { S_CodecUtilClose(&rv); return NULL; diff --git a/Quake/snd_mem.c b/Quake/snd_mem.c index 2c0453fb..02189492 100644 --- a/Quake/snd_mem.c +++ b/Quake/snd_mem.c @@ -71,7 +71,7 @@ sfxcache_t *S_LoadSound (sfx_t *s) if (!sc) return NULL; - float ratio = info.rate / shm->speed; + float ratio = (float)info.rate / (float)shm->speed; sc->length = resampledNumSamples; sc->loopstart = (info.loopstart == -1 ? -1 : info.loopstart / ratio); // reposition loop marker to take resampling into account