Fix divide by zero in SoundOutputProvider.
This commit is contained in:
parent
e3e5ae4934
commit
5026d39da1
|
@ -139,7 +139,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
BaseSoundProvider.GetSamples(out samples, out count);
|
BaseSoundProvider.GetSamples(out samples, out count);
|
||||||
|
|
||||||
scaleFactor *= SamplesPerFrame / count;
|
if (count != 0)
|
||||||
|
{
|
||||||
|
scaleFactor *= SamplesPerFrame / count;
|
||||||
|
}
|
||||||
|
|
||||||
double newCountTarget = count * scaleFactor;
|
double newCountTarget = count * scaleFactor;
|
||||||
int newCount = (int)Math.Round(newCountTarget + _resampleLengthRoundingError);
|
int newCount = (int)Math.Round(newCountTarget + _resampleLengthRoundingError);
|
||||||
|
|
Loading…
Reference in New Issue