Merge branch 'viv/inf_spf' of cinnabon/rustro into matriarch

This commit is contained in:
Vivian Lim 2019-12-24 05:27:09 +00:00 committed by Gitea
commit 801896cff6

View file

@ -158,7 +158,7 @@ impl MyEmulator {
// similar hack to the sample rate, make sure we don't divide by zero. // similar hack to the sample rate, make sure we don't divide by zero.
let mut spf = 1.0 / self.av_info.timing.fps; let mut spf = 1.0 / self.av_info.timing.fps;
if spf.is_nan() { if spf.is_nan() || spf.is_infinite() {
spf = 1.0 / 60.0; spf = 1.0 / 60.0;
} }
Duration::from_secs_f64(spf) Duration::from_secs_f64(spf)