Prevent crash in SoundOutputProvider due to negative sample count being computed
In practice this doesn't occur ever except with subframe core abuse with tiny sample counts being spammed
This commit is contained in:
parent
60d7ddbffc
commit
5a020c1e9e
|
@ -263,7 +263,11 @@ namespace BizHawk.Client.Common
|
|||
// would drift by ~22 milliseconds per minute.
|
||||
_resampleLengthRoundingError = newCountExact - count;
|
||||
|
||||
AddSamplesToBuffer(samples, count);
|
||||
if (count > 0)
|
||||
{
|
||||
// in rare cases (with subframe core tiny sample spam) count can be negative, somehow
|
||||
AddSamplesToBuffer(samples, count);
|
||||
}
|
||||
}
|
||||
|
||||
private static double CalculatePowerMean(IEnumerable<int> values, double power)
|
||||
|
|
Loading…
Reference in New Issue