fix bugs in last commit

This commit is contained in:
Eric Wasylishen 2011-01-17 13:54:17 -07:00
parent c2a9180391
commit 85d97fac9a
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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