Fix fast-forward when using audio throttle and XAudio2 or OpenAL.
This commit is contained in:
parent
970a9017d4
commit
f2e9ca2ac9
|
@ -172,7 +172,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_outputProvider.BaseSoundProvider.GetSamplesSync(out samples, out samplesProvided);
|
_outputProvider.BaseSoundProvider.GetSamplesSync(out samples, out samplesProvided);
|
||||||
|
|
||||||
while (samplesNeeded < samplesProvided && !Global.DisableSecondaryThrottling)
|
if (Global.DisableSecondaryThrottling && samplesProvided > samplesNeeded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (samplesProvided > samplesNeeded)
|
||||||
{
|
{
|
||||||
Thread.Sleep((samplesProvided - samplesNeeded) / (SampleRate / 1000)); // Let the audio clock control sleep time
|
Thread.Sleep((samplesProvided - samplesNeeded) / (SampleRate / 1000)); // Let the audio clock control sleep time
|
||||||
samplesNeeded = _outputDevice.CalculateSamplesNeeded();
|
samplesNeeded = _outputDevice.CalculateSamplesNeeded();
|
||||||
|
|
Loading…
Reference in New Issue