mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-18 08:51:24 +00:00
fix bugs in last commit
This commit is contained in:
parent
c2a9180391
commit
85d97fac9a
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue