diff audioio/AudioCallbackPlaySource.cpp @ 402:f7dddea0dbe0

Fix #1047 Floating-point exception on exit if no file loaded
author Chris Cannam
date Mon, 01 Sep 2014 16:50:26 +0100
parents f747be6743ab
children ddfb480c70a0
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Mon Sep 01 13:37:22 2014 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Mon Sep 01 16:50:26 2014 +0100
@@ -610,7 +610,11 @@
 
     int targetRate = getTargetSampleRate();
     int latency = m_playLatency; // at target rate
-    RealTime latency_t = RealTime::frame2RealTime(latency, targetRate);
+    RealTime latency_t = RealTime::zeroTime;
+
+    if (targetRate != 0) {
+        latency_t = RealTime::frame2RealTime(latency, targetRate);
+    }
 
     return getCurrentFrame(latency_t);
 }