diff audioio/AudioCallbackPlaySource.cpp @ 414:b65ee5c4f8bc

Refuse to play if no sample rate available (fixes crash when playing after deleting only pane)
author Chris Cannam
date Fri, 12 Sep 2014 16:59:52 +0100
parents ddfb480c70a0
children 8d2112977aa0 dee4aceb131c
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Tue Sep 09 16:52:24 2014 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Fri Sep 12 16:59:52 2014 +0100
@@ -399,6 +399,11 @@
 void
 AudioCallbackPlaySource::play(int startFrame)
 {
+    if (!m_sourceSampleRate) {
+        cerr << "AudioCallbackPlaySource::play: No source sample rate available, not playing" << endl;
+        return;
+    }
+    
     if (m_viewManager->getPlaySelectionMode() &&
 	!m_viewManager->getSelections().empty()) {