comparison 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
comparison
equal deleted inserted replaced
399:81e41a430b58 402:f7dddea0dbe0
608 // This method attempts to estimate which audio sample frame is 608 // This method attempts to estimate which audio sample frame is
609 // "currently coming through the speakers". 609 // "currently coming through the speakers".
610 610
611 int targetRate = getTargetSampleRate(); 611 int targetRate = getTargetSampleRate();
612 int latency = m_playLatency; // at target rate 612 int latency = m_playLatency; // at target rate
613 RealTime latency_t = RealTime::frame2RealTime(latency, targetRate); 613 RealTime latency_t = RealTime::zeroTime;
614
615 if (targetRate != 0) {
616 latency_t = RealTime::frame2RealTime(latency, targetRate);
617 }
614 618
615 return getCurrentFrame(latency_t); 619 return getCurrentFrame(latency_t);
616 } 620 }
617 621
618 int 622 int