- Fixed a few bugs with ringbuffer, and some cleanup.

- Reworked audio system to use semaphores instead of events for waiting.
  Should fix rare issues where the XAudio2 driver would run out of buffers
  even though it was supposed to be guarded against that.
This commit is contained in:
gibbed
2015-06-19 21:48:51 -05:00
parent f3547a832f
commit edbd724370
8 changed files with 118 additions and 111 deletions

View File

@@ -21,7 +21,7 @@ namespace xaudio2 {
class XAudio2AudioDriver : public AudioDriver {
public:
XAudio2AudioDriver(Emulator* emulator, HANDLE wait);
XAudio2AudioDriver(Emulator* emulator, HANDLE semaphore);
virtual ~XAudio2AudioDriver();
virtual void Initialize();
@@ -32,7 +32,7 @@ class XAudio2AudioDriver : public AudioDriver {
IXAudio2* audio_;
IXAudio2MasteringVoice* mastering_voice_;
IXAudio2SourceVoice* pcm_voice_;
HANDLE wait_handle_;
HANDLE semaphore_;
class VoiceCallback;
VoiceCallback* voice_callback_;