changeset 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 81e41a430b58
children eb84b06301da
files audioio/AudioCallbackPlaySource.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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);
 }