mirror of
https://github.com/vsariola/sointu.git
synced 2026-03-01 03:23:17 -05:00
fix(tracker): show FPU over/underflow error instead of generic nan error
This commit is contained in:
parent
4d29a191c8
commit
f3bb0001cd
@ -131,11 +131,12 @@ func (p *Player) Process(buffer sointu.AudioBuffer, context PlayerProcessContext
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
p.destroySynth()
|
p.destroySynth()
|
||||||
p.send(Alert{Message: fmt.Sprintf("synth.Render: %s", err.Error()), Priority: Error, Name: "PlayerCrash", Duration: defaultAlertDuration})
|
p.send(Alert{Message: fmt.Sprintf("synth.Render: %s", err.Error()), Priority: Error, Name: "PlayerCrash", Duration: defaultAlertDuration})
|
||||||
}
|
} else {
|
||||||
// for performance, we don't check for NaN of every sample, because typically NaNs propagate
|
// for performance, we don't check for NaN of every sample, because typically NaNs propagate
|
||||||
if rendered > 0 && (isNaN(buffer[0][0]) || isNaN(buffer[0][1]) || isInf(buffer[0][0]) || isInf(buffer[0][1])) {
|
if rendered > 0 && (isNaN(buffer[0][0]) || isNaN(buffer[0][1]) || isInf(buffer[0][0]) || isInf(buffer[0][1])) {
|
||||||
p.destroySynth()
|
p.destroySynth()
|
||||||
p.send(Alert{Message: "Inf or NaN detected in synth output", Priority: Error, Name: "PlayerCrash", Duration: defaultAlertDuration})
|
p.send(Alert{Message: "Inf or NaN detected in synth output", Priority: Error, Name: "PlayerCrash", Duration: defaultAlertDuration})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rendered = min(framesUntilEvent, timeUntilRowAdvance)
|
rendered = min(framesUntilEvent, timeUntilRowAdvance)
|
||||||
|
|||||||
Reference in New Issue
Block a user