Don't lock while calling SOUNDMAN driver calls (mutex ordering requirement).
This commit is contained in:
@@ -108,11 +108,11 @@ RageSound &RageSound::operator=( const RageSound &cpy )
|
|||||||
|
|
||||||
void RageSound::Unload()
|
void RageSound::Unload()
|
||||||
{
|
{
|
||||||
LockMut(m_Mutex);
|
if( IsPlaying() )
|
||||||
|
|
||||||
if(IsPlaying())
|
|
||||||
StopPlaying();
|
StopPlaying();
|
||||||
|
|
||||||
|
LockMut(m_Mutex);
|
||||||
|
|
||||||
delete m_pSource;
|
delete m_pSource;
|
||||||
m_pSource = NULL;
|
m_pSource = NULL;
|
||||||
|
|
||||||
@@ -326,6 +326,9 @@ void RageSound::StartPlaying()
|
|||||||
m_Param.m_Volume = 0;
|
m_Param.m_Volume = 0;
|
||||||
ApplyParams();
|
ApplyParams();
|
||||||
|
|
||||||
|
/* Don't lock while calling SOUNDMAN driver calls. */
|
||||||
|
ASSERT( !m_Mutex.IsLockedByThisThread() );
|
||||||
|
|
||||||
SOUNDMAN->StartMixing( this );
|
SOUNDMAN->StartMixing( this );
|
||||||
|
|
||||||
// LOG->Trace("StartPlaying %p finished (%s)", this, this->GetLoadedFilePath().c_str());
|
// LOG->Trace("StartPlaying %p finished (%s)", this, this->GetLoadedFilePath().c_str());
|
||||||
@@ -333,6 +336,9 @@ void RageSound::StartPlaying()
|
|||||||
|
|
||||||
void RageSound::StopPlaying()
|
void RageSound::StopPlaying()
|
||||||
{
|
{
|
||||||
|
/* Don't lock while calling SOUNDMAN driver calls. */
|
||||||
|
ASSERT( !m_Mutex.IsLockedByThisThread() );
|
||||||
|
|
||||||
/* Tell the sound driver to stop mixing this sound. */
|
/* Tell the sound driver to stop mixing this sound. */
|
||||||
SOUNDMAN->StopMixing(this);
|
SOUNDMAN->StopMixing(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user