diff options
author | Andrey Nazarov <skuller@skuller.net> | 2010-08-01 20:53:20 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2010-08-01 20:53:20 +0000 |
commit | 19691ff84f13e778975fb587d086489bd896f437 (patch) | |
tree | 0c90c3f912e153d38d3ad8e86ee263c594fea660 /source/snd_mem.c | |
parent | 9a0fcb9662bbcf809318a6fcf84b4798efeeabcc (diff) |
Stop spamming about missing or invalid sounds.
Don't try to reload the sound multiple times after an error.
Display sound load failure reasons in the output of ‘soundlist’ command.
Diffstat (limited to 'source/snd_mem.c')
-rw-r--r-- | source/snd_mem.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/snd_mem.c b/source/snd_mem.c index 3b81a08..a884f07 100644 --- a/source/snd_mem.c +++ b/source/snd_mem.c @@ -277,12 +277,10 @@ static qboolean GetWavinfo( void ) { } samples = iff_chunk_len / s_info.width; -#if 0 if( !samples ) { Com_DPrintf( "%s has zero length\n", s_info.name ); return qfalse; } -#endif if( s_info.samples ) { if( samples < s_info.samples ) { @@ -319,6 +317,10 @@ sfxcache_t *S_LoadSound (sfx_t *s) { if (sc) return sc; +// don't retry after error + if (s->error) + return NULL; + // load it in if (s->truename) name = s->truename; @@ -364,9 +366,11 @@ sfxcache_t *S_LoadSound (sfx_t *s) { fail2: FS_FreeFile( data ); fail1: - if( ret && ret != Q_ERR_NOENT ) { + // don't spam about missing or invalid sounds (action mod hack) + if( ret && ret != Q_ERR_NOENT && ret != Q_ERR_INVALID_FORMAT ) { Com_EPrintf( "Couldn't load %s: %s\n", namebuffer, Q_ErrorString( ret ) ); } + s->error = ret; return sc; } |