From 6ae54e8ea247c479bc3bba549ed3e37fa920ea0f Mon Sep 17 00:00:00 2001 From: Vivian Lim Date: Mon, 23 Dec 2019 21:24:45 -0800 Subject: [PATCH] add check for infinite framerate, which I saw on gambatte/windows --- examples/sdl2_emulator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sdl2_emulator.rs b/examples/sdl2_emulator.rs index 8ca7db2..293dc90 100644 --- a/examples/sdl2_emulator.rs +++ b/examples/sdl2_emulator.rs @@ -158,7 +158,7 @@ impl MyEmulator { // similar hack to the sample rate, make sure we don't divide by zero. 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; } Duration::from_secs_f64(spf)