diff core/RTAudio.cpp @ 375:768acdeea362 prerelease

Merge
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 10 Jun 2016 00:35:18 +0100
parents 3bed6b09223c
children a0698d523a6a
line wrap: on
line diff
--- a/core/RTAudio.cpp	Fri Jun 10 00:02:48 2016 +0100
+++ b/core/RTAudio.cpp	Fri Jun 10 00:35:18 2016 +0100
@@ -152,12 +152,12 @@
 	}
 
 	// Limit the analog channels to sane values
-	if(settings->numAnalogChannels >= 8)
-		settings->numAnalogChannels = 8;
-	else if(settings->numAnalogChannels >= 4)
-		settings->numAnalogChannels = 4;
-	else
-		settings->numAnalogChannels = 2;
+	if(settings->numAnalogChannels != 2 
+		&& settings->numAnalogChannels != 4
+		&& settings->numAnalogChannels != 8) {
+			cout << "Invalid number of analog channels: " << settings->numAnalogChannels << ". Valid values are 2, 4, 8.\n";
+			return -1;
+	}
 
 	// Initialise the rendering environment: sample rates, frame counts, numbers of channels
 	gContext.audioSampleRate = 44100.0;