]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
no longer calls S_StopAllSounds when sound system restarts, and cleaned up a sound...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:40:07 +0000 (06:40 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Jan 2005 06:40:07 +0000 (06:40 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4927 d7cf8633-e32d-0410-b094-e92efae38249

snd_main.c

index 019c59be499c6531d7f5a931b6a6b453eaba1747..ede502866e66f32e7f3ae39002ad197e18f11ae5 100644 (file)
@@ -31,8 +31,6 @@ void S_Play2(void);
 void S_SoundList(void);
 void S_Update_();
 
-void S_ClearBuffer (void);
-
 
 // =======================================================================
 // Internal sound data & structures
@@ -143,8 +141,6 @@ void S_Startup(void)
        sound_started = true;
 
        Con_DPrintf("Sound sampling rate: %i\n", shm->format.speed);
-
-       S_StopAllSounds ();
 }
 
 void S_Shutdown(void)
@@ -260,7 +256,6 @@ sfx_t *S_FindName (const char *name)
        if (!snd_initialized.integer)
                return NULL;
 
-       // Add the default sound directory to the path
        if (strlen (name) >= sizeof (sfx->name))
                Host_Error ("S_FindName: sound name too long (%s)", name);
 
@@ -326,6 +321,7 @@ S_ServerSounds
 void S_ServerSounds (char serversound [][MAX_QPATH], unsigned int numsounds)
 {
        sfx_t *sfx;
+       sfx_t *sfxnext;
        unsigned int i;
 
        // Start the ambient sounds and make them loop
@@ -366,16 +362,10 @@ void S_ServerSounds (char serversound [][MAX_QPATH], unsigned int numsounds)
        }
 
        // Free all unlocked sfx
-       sfx = known_sfx;
-       while (sfx != NULL)
+       for (sfx = known_sfx;sfx;sfx = sfxnext)
        {
-               sfx_t* crtsfx;
-
-               // We may lose the "next" pointer after S_FreeSfx
-               crtsfx = sfx;
-               sfx = sfx->next;
-
-               S_FreeSfx (crtsfx, false);
+               sfxnext = sfx->next;
+               S_FreeSfx (sfx);
        }
 }