changeset 417:d62a622a0e40 tonioni

Merge from default branch
author Chris Cannam
date Mon, 10 Nov 2014 09:20:33 +0000
parents c1b2b8b84165 (current diff) 7b2dd0d4c366 (diff)
children 8d2112977aa0
files
diffstat 3 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Tue Sep 09 16:36:21 2014 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Mon Nov 10 09:20:33 2014 +0000
@@ -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()) {
 
--- a/audioio/AudioJACKTarget.cpp	Tue Sep 09 16:36:21 2014 +0100
+++ b/audioio/AudioJACKTarget.cpp	Mon Nov 10 09:20:33 2014 +0000
@@ -178,7 +178,7 @@
     typedef void (*func)(jack_port_t *, jack_latency_callback_mode_t, jack_latency_range_t *);
     void *s = symbol("jack_port_get_latency_range");
     if (!s) {
-        range.min = range.max = 0;
+        range->min = range->max = 0;
         return;
     }
     func f = (func)s;
@@ -367,11 +367,12 @@
 #endif
 
     while ((int)m_outputs.size() < channels) {
-	
-	char name[20];
+
+        const int namelen = 30;
+	char name[namelen];
 	jack_port_t *port;
 
-	sprintf(name, "out %d", int(m_outputs.size() + 1));
+	snprintf(name, namelen, "out %d", int(m_outputs.size() + 1));
 
 	port = jack_port_register(m_client,
 				  name,
--- a/framework/MainWindowBase.cpp	Tue Sep 09 16:36:21 2014 +0100
+++ b/framework/MainWindowBase.cpp	Mon Nov 10 09:20:33 2014 +0000
@@ -1268,7 +1268,14 @@
 
 //    cerr << "template is: \"" << templateName << "\"" << endl;
 
-    if (!source.isAvailable()) return FileOpenFailed;
+    if (!source.isAvailable()) {
+        if (source.wasCancelled()) {
+            return FileOpenCancelled;
+        } else {
+            return FileOpenFailed;
+        }
+    }
+
     source.waitForData();
 
     m_openingAudioFile = true;
@@ -1286,7 +1293,11 @@
     if (!newModel->isOK()) {
 	delete newModel;
         m_openingAudioFile = false;
-	return FileOpenFailed;
+        if (source.wasCancelled()) {
+            return FileOpenCancelled;
+        } else { 
+            return FileOpenFailed;
+        }
     }
 
 //    cerr << "mode = " << mode << endl;