From 13da77d5c2c9fd4077c590493559094c46ed267f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 11 Mar 2005 00:28:16 +0000 Subject: [PATCH] only pause playing sounds; unpause sound slot after stopping --- .../src/arch/Sound/RageSoundDriver_Generic_Software.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp index 3ff0241b0e..e390bac719 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_Generic_Software.cpp @@ -74,6 +74,7 @@ void RageSound_Generic_Software::Mix( int16_t *buf, int frames, int64_t frameno, s.Deallocate(); s.state = sound::STOPPED; s.available = true; /* do this last */ + s.paused = false; // LOG->Trace("set %p from HALTING to STOPPED", sounds[i].snd); continue; @@ -411,7 +412,11 @@ bool RageSound_Generic_Software::PauseMixing( RageSoundBase *snd, bool bStop ) if( !sounds[i].available && sounds[i].snd == snd ) break; - if( i == ARRAYSIZE(sounds) ) + /* A sound can be paused in PLAYING or STOPPING. (STOPPING means the sound + * has been decoded to the end, and we're waiting for that data to finish, so + * externally it looks and acts like PLAYING.) */ + if( i == ARRAYSIZE(sounds) || + (sounds[i].state != sound::PLAYING && sounds[i].state != sound::STOPPING) ) { LOG->Trace( "not pausing a sound because it's not playing" ); return false;