Permalink
Browse files

joining the audio::Track queue thread on stop

  • Loading branch information...
1 parent 5a95b0d commit 165bf25b5c0247aa71106d4add41f8c31d81444d Mike O'Toole committed Apr 23, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/cinder/audio/Output.cpp
@@ -613,12 +613,12 @@ void OutputXAudio::Track::play()
void OutputXAudio::Track::stop()
{
- //mLoader->stop();
+ if( ! mIsPlaying ) return;
mSourceVoice->Stop( 0, XAUDIO2_COMMIT_NOW ); //might not really need this
- mSourceVoice->FlushSourceBuffers();
mIsPlaying = false;
SetEvent( mBufferEndEvent ); //signals event to end queuethread
- //might need to clean out the buffers here
+ mQueueThread->join();
+ mSourceVoice->FlushSourceBuffers();
}
void OutputXAudio::Track::setVolume( float aVolume )
@@ -652,7 +652,7 @@ void OutputXAudio::Track::fillBuffer()
//tell the loader to go fuck itself?
break;
}
-
+
BufferList bufferList;
bufferList.mNumberBuffers = 1;
Buffer buffer;

0 comments on commit 165bf25

Please sign in to comment.