From 2d512121f1145cdc40f007c35b78f6e7c67250f8 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 12 Aug 2016 22:33:13 +0300 Subject: [PATCH] XAudio2.8+ fix --- rpcs3/Emu/Audio/XAudio2/XAudio28Thread.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rpcs3/Emu/Audio/XAudio2/XAudio28Thread.cpp b/rpcs3/Emu/Audio/XAudio2/XAudio28Thread.cpp index 6fc1a3b58e..1869c3d81d 100644 --- a/rpcs3/Emu/Audio/XAudio2/XAudio28Thread.cpp +++ b/rpcs3/Emu/Audio/XAudio2/XAudio28Thread.cpp @@ -131,6 +131,16 @@ void XAudio2Thread::xa28_open() void XAudio2Thread::xa28_add(const void* src, int size) { + XAUDIO2_VOICE_STATE state; + s_tls_source_voice->GetState(&state); + + if (state.BuffersQueued > 32) + { + LOG_WARNING(GENERAL, "XAudio2Thread : too many buffers enqueued (%d, pos=%u)", state.BuffersQueued, state.SamplesPlayed); + + return xa28_flush(); + } + XAUDIO2_BUFFER buffer; buffer.AudioBytes = size;