diff --git a/win32/CDirectSound.h b/win32/CDirectSound.h index e5f89f01..d1b80e7d 100644 --- a/win32/CDirectSound.h +++ b/win32/CDirectSound.h @@ -199,9 +199,9 @@ private: int blockCount; // number of blocks in the buffer int blockSize; // bytes in one block - int blockSamples; + int blockSamples; // samples in one block int bufferSize; // bytes in the whole buffer - int blockTime; + int blockTime; // ms in one block DWORD last_block; // the last block that was mixed diff --git a/win32/win32_sound.cpp b/win32/win32_sound.cpp index 04ddf959..55cae453 100644 --- a/win32/win32_sound.cpp +++ b/win32/win32_sound.cpp @@ -239,6 +239,7 @@ returns true if successful, false otherwise */ bool8 S9xOpenSoundDevice () { + S9xSetSamplesAvailableCallback (NULL, NULL); // point the interface to the correct output object switch(GUI.SoundDriver) { case WIN_SNES9X_DIRECT_SOUND_DRIVER: @@ -266,8 +267,12 @@ bool8 S9xOpenSoundDevice () } if(!S9xSoundOutput->InitSoundOutput()) return false; + + if(!S9xSoundOutput->SetupSound()) + return false; + S9xSetSamplesAvailableCallback (S9xSoundCallback, NULL); - return S9xSoundOutput->SetupSound(); + return true; } /* S9xSoundCallback