mirror of
https://github.com/holub/mame
synced 2025-04-26 18:23:08 +03:00
Try to fix audio delay regression caused when fixing -refreshspeed for
-sound xaudio2
This commit is contained in:
parent
92858ce2c4
commit
9f21eabe21
@ -596,6 +596,10 @@ void sound_xaudio2::submit_needed()
|
|||||||
XAUDIO2_VOICE_STATE state;
|
XAUDIO2_VOICE_STATE state;
|
||||||
m_sourceVoice->GetState(&state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
m_sourceVoice->GetState(&state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
|
||||||
|
|
||||||
|
// If we have a too many buffers on the queue, flush to resync
|
||||||
|
if (state.BuffersQueued > 2)
|
||||||
|
m_sourceVoice->FlushSourceBuffers();
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(m_buffer_lock);
|
std::lock_guard<std::mutex> lock(m_buffer_lock);
|
||||||
|
|
||||||
// Roll the buffer
|
// Roll the buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user