Simplify (why'd I do this? unneeded)
This commit is contained in:
@@ -46,10 +46,10 @@ void RageSound_DSound::MixerThread()
|
|||||||
while(!shutdown) {
|
while(!shutdown) {
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
|
|
||||||
/* Sleep for the size of one chunk, or until we're signalled. */
|
/* Sleep for the size of one chunk. */
|
||||||
const int chunksize_frames = buffersize_frames / num_chunks;
|
const int chunksize_frames = buffersize_frames / num_chunks;
|
||||||
float sleep_secs = (float(chunksize_frames) / samplerate);
|
float sleep_secs = (float(chunksize_frames) / samplerate);
|
||||||
WaitForSingleObject( m_ThreadWakeupEvent, int(1000 * sleep_secs) );
|
Sleep(int(1000 * sleep_secs));
|
||||||
|
|
||||||
CHECKPOINT;
|
CHECKPOINT;
|
||||||
LockMutex L(SOUNDMAN->lock);
|
LockMutex L(SOUNDMAN->lock);
|
||||||
@@ -217,7 +217,6 @@ RageSound_DSound::RageSound_DSound()
|
|||||||
/* Set channel volumes. */
|
/* Set channel volumes. */
|
||||||
VolumeChanged();
|
VolumeChanged();
|
||||||
|
|
||||||
m_ThreadWakeupEvent = CreateEvent( NULL, false, false, NULL );
|
|
||||||
MixingThread.SetName("Mixer thread");
|
MixingThread.SetName("Mixer thread");
|
||||||
MixingThread.Create( MixerThread_start, this );
|
MixingThread.Create( MixerThread_start, this );
|
||||||
}
|
}
|
||||||
@@ -234,8 +233,6 @@ RageSound_DSound::~RageSound_DSound()
|
|||||||
|
|
||||||
for(unsigned i = 0; i < stream_pool.size(); ++i)
|
for(unsigned i = 0; i < stream_pool.size(); ++i)
|
||||||
delete stream_pool[i];
|
delete stream_pool[i];
|
||||||
|
|
||||||
CloseHandle( m_ThreadWakeupEvent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RageSound_DSound::VolumeChanged()
|
void RageSound_DSound::VolumeChanged()
|
||||||
@@ -283,10 +280,6 @@ void RageSound_DSound::StartMixing( RageSoundBase *snd )
|
|||||||
if(stream_pool[i]->state == stream_pool[i]->INACTIVE)
|
if(stream_pool[i]->state == stream_pool[i]->INACTIVE)
|
||||||
stream_pool[i]->state = stream_pool[i]->PLAYING;
|
stream_pool[i]->state = stream_pool[i]->PLAYING;
|
||||||
|
|
||||||
/* Kick the decoder thread, so it'll start this sound up quickly. */
|
|
||||||
L.Unlock();
|
|
||||||
SetEvent( m_ThreadWakeupEvent );
|
|
||||||
|
|
||||||
// LOG->Trace("new sound assigned to channel %i", i);
|
// LOG->Trace("new sound assigned to channel %i", i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class RageSound_DSound: public RageSoundDriver
|
|||||||
|
|
||||||
DSound ds;
|
DSound ds;
|
||||||
|
|
||||||
HANDLE m_ThreadWakeupEvent;
|
|
||||||
bool shutdown; /* tells the MixerThread to shut down */
|
bool shutdown; /* tells the MixerThread to shut down */
|
||||||
static int MixerThread_start(void *p);
|
static int MixerThread_start(void *p);
|
||||||
void MixerThread();
|
void MixerThread();
|
||||||
|
|||||||
Reference in New Issue
Block a user