summaryrefslogtreecommitdiff
path: root/RtAudio.cpp
diff options
context:
space:
mode:
authorGary Scavone <gary@music.mcgill.ca>2015-02-23 13:54:50 -0500
committerGary Scavone <gary@music.mcgill.ca>2015-02-23 13:54:50 -0500
commit06296a58ed09b4570b34bb6fdcdb87a59c3b89a3 (patch)
tree377e893d5caba5435ca0aa7e4f07c90da142a9ec /RtAudio.cpp
parent7d46492974db4140989768e91a659ad46652ef55 (diff)
Small ASIO update to support buffersize value of 0 (setting to preferred size).
Diffstat (limited to 'RtAudio.cpp')
-rw-r--r--RtAudio.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index 31bef71..4d4c85f 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -3012,7 +3012,8 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
*bufferSize = stream_.bufferSize;
} else {
- if ( *bufferSize < (unsigned int) minSize ) *bufferSize = (unsigned int) minSize;
+ if ( *bufferSize == 0 ) *bufferSize = preferSize;
+ else if ( *bufferSize < (unsigned int) minSize ) *bufferSize = (unsigned int) minSize;
else if ( *bufferSize > (unsigned int) maxSize ) *bufferSize = (unsigned int) maxSize;
else if ( granularity == -1 ) {
// Make sure bufferSize is a power of two.