mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
A couple of quick fixes to avoid deadlocks during playback.
This commit is contained in:
parent
b32241ea8a
commit
a822298c61
@ -194,7 +194,7 @@ bool WaveOut::Shutdown(void)
|
|||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
|
|
||||||
boost::mutex::scoped_lock lock(this->audioMutex);
|
// boost::mutex::scoped_lock lock(this->audioMutex);
|
||||||
|
|
||||||
if(this->audioThread)
|
if(this->audioThread)
|
||||||
{
|
{
|
||||||
@ -286,11 +286,11 @@ bool WaveOut::SetFormat(unsigned long SampleRate, unsigned long Channels)
|
|||||||
//
|
//
|
||||||
bool WaveOut::Start(void)
|
bool WaveOut::Start(void)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(this->audioMutex);
|
|
||||||
|
|
||||||
if(!Open())
|
if(!Open())
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
|
boost::mutex::scoped_lock lock(this->audioMutex);
|
||||||
|
|
||||||
while(m_QueuedBuffers) // Handles pause/play?
|
while(m_QueuedBuffers) // Handles pause/play?
|
||||||
{
|
{
|
||||||
waveOutWrite(m_waveHandle, &m_Buffers[m_ActiveBuffer], sizeof(WAVEHDR));
|
waveOutWrite(m_waveHandle, &m_Buffers[m_ActiveBuffer], sizeof(WAVEHDR));
|
||||||
|
Loading…
Reference in New Issue
Block a user