# HG changeset patch
# User Chris Cannam
# Date 1410537592 -3600
# Node ID b65ee5c4f8bcae737888a0ea8fe3cb9261b3ffd6
# Parent  a39a7d6b0f2d0b6bff0b580b733f7db69c63c135
Refuse to play if no sample rate available (fixes crash when playing after deleting only pane)

diff -r a39a7d6b0f2d -r b65ee5c4f8bc audioio/AudioCallbackPlaySource.cpp
--- 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()) {