- Fixed: S_ClearSoundData() did not stop any channels before freeing the

samples, a problem for the alternate sound renderer if it happened to be
  playing any sounds at the time, since it would try to keep on playing them.

SVN r483 (trunk)
This commit is contained in:
Randy Heit 2007-02-14 20:18:22 +00:00
parent dea5cf9ba4
commit 58d4c4f9ae
7 changed files with 42 additions and 1 deletions

View file

@ -1,3 +1,8 @@
February 14, 2007
- Fixed: S_ClearSoundData() did not stop any channels before freeing the
samples, a problem for the alternate sound renderer if it happened to be
playing any sounds at the time, since it would try to keep on playing them.
February 12, 2007
- Added two new cvars (win_x and win_y) that keep track of the window
position when not playing in fullscreen mode.
@ -43,7 +48,7 @@ February 3, 2007
February 2, 2007
- Added a new fixrtext tool that sets the IMAGE_SCN_MEM_WRITE flag for
.rtext files in the assembly object files. Now I can avoid doing this at
.rtext sections in the assembly object files. Now I can avoid doing this at
runtime, which means that ZDoom is now UPX-compatible if anyone wants to
pack it.

View file

@ -746,6 +746,7 @@ static void S_ClearSoundData()
if (GSnd != NULL)
{
GSnd->StopAllChannels();
for (i = 0; i < S_sfx.Size(); ++i)
{
GSnd->UnloadSound (&S_sfx[i]);

View file

@ -546,6 +546,23 @@ void AltSoundRenderer::StopSound (long handle)
chan->Sample = NULL;
}
//==========================================================================
//
// AltSoundRenderer :: StopAllChannels
//
//==========================================================================
void AltSoundRenderer::StopAllChannels ()
{
if (Channels != NULL)
{
for (int i = 0; i < NumChannels; ++i)
{
Channels[i].Sample = NULL;
}
}
}
//==========================================================================
//
// AltSoundRenderer :: SetSfxPaused

View file

@ -30,6 +30,9 @@ public:
// Stops a sound channel.
void StopSound (long handle);
// Stops all sounds.
void StopAllChannels ();
// Pauses or resumes all sound effect channels.
void SetSfxPaused (bool paused);

View file

@ -756,6 +756,15 @@ void FMODSoundRenderer::StopSound (long handle)
}
}
void FMODSoundRenderer::StopAllChannels ()
{
for (long i = 1; i <= NumChannels; ++i)
{
StopSound (i);
}
}
void FMODSoundRenderer::SetSfxPaused (bool paused)
{
for (int i = 0; i < NumChannels; ++i)

View file

@ -32,6 +32,9 @@ public:
// Stops a sound channel.
void StopSound (long handle);
// Stops all sounds.
void StopAllChannels ();
// Pauses or resumes all sound effect channels.
void SetSfxPaused (bool paused);

View file

@ -99,6 +99,9 @@ public:
// Stops a sound channel.
virtual void StopSound (long handle) = 0;
// Stops all sounds.
virtual void StopAllChannels () = 0;
// Pauses or resumes all sound effect channels.
virtual void SetSfxPaused (bool paused) = 0;