add StartDecodeThread to fix potential GetSampleRate race
(will break sound drivers until I update them)
This commit is contained in:
@@ -288,12 +288,17 @@ void RageSound_Generic_Software::StopMixing( RageSoundBase *snd )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RageSound_Generic_Software::StartDecodeThread()
|
||||||
|
{
|
||||||
|
ASSERT( !m_DecodeThread.IsCreated() );
|
||||||
|
m_DecodeThread.Create( DecodeThread_start, this );
|
||||||
|
}
|
||||||
|
|
||||||
RageSound_Generic_Software::RageSound_Generic_Software()
|
RageSound_Generic_Software::RageSound_Generic_Software()
|
||||||
{
|
{
|
||||||
shutdown_decode_thread = false;
|
shutdown_decode_thread = false;
|
||||||
|
|
||||||
m_DecodeThread.SetName("Decode thread");
|
m_DecodeThread.SetName("Decode thread");
|
||||||
m_DecodeThread.Create( DecodeThread_start, this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RageSound_Generic_Software::~RageSound_Generic_Software()
|
RageSound_Generic_Software::~RageSound_Generic_Software()
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ class RageSound_Generic_Software: public RageSoundDriver
|
|||||||
bool GetDataForSound( sound &s );
|
bool GetDataForSound( sound &s );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* Start the decoding. This should be called once the hardware is set up and
|
||||||
|
* GetSampleRate will return the correct value. */
|
||||||
|
void StartDecodeThread();
|
||||||
|
|
||||||
/* Override this to set the priority of the decoding thread, which should be above
|
/* Override this to set the priority of the decoding thread, which should be above
|
||||||
* normal priority but not realtime. */
|
* normal priority but not realtime. */
|
||||||
virtual void SetupDecodingThread() { }
|
virtual void SetupDecodingThread() { }
|
||||||
|
|||||||
Reference in New Issue
Block a user