summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Scavone <gary@music.mcgill.ca>2009-05-17 21:11:45 +0000
committerStephen Sinclair <sinclair@music.mcgill.ca>2013-10-11 01:38:25 +0200
commit089a6da80694960318b86201b2fab3caa2680113 (patch)
tree67c7d13be9f9e6723ae4392411814933c1a98210
parent1022a7876a6ef1980ad5518340df177814783c7f (diff)
Bug fixes for ALSA buffersize setting and new OS X 10.5 variable (GS).
-rw-r--r--RtAudio.cpp4
-rw-r--r--configure.ac2
-rw-r--r--tests/record.cpp3
3 files changed, 5 insertions, 4 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp
index cd427f3..61cba82 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -403,7 +403,9 @@ unsigned int RtApi :: getStreamSampleRate( void )
// implementation.
struct CoreHandle {
AudioDeviceID id[2]; // device ids
+#if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 )
AudioDeviceIOProcID procId[2];
+#endif
UInt32 iStream[2]; // device stream index (or first if using multiple)
UInt32 nStreams[2]; // number of streams to use
bool xrun[2];
@@ -5646,7 +5648,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
}
// Set the buffer number, which in ALSA is referred to as the "period".
- int totalSize, dir;
+ int totalSize, dir = 0;
unsigned int periods = 0;
if ( options ) periods = options->numberOfBuffers;
totalSize = *bufferSize * periods;
diff --git a/configure.ac b/configure.ac
index 97989d2..1303437 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ AC_CONFIG_FILES([rtaudio-config Makefile tests/Makefile])
AC_SUBST( GXX, ["no"] )
# Checks for programs.
-AC_PROG_CXX
+AC_PROG_CXX(g++ CC c++ cxx)
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar, no)
if [[ $AR = "no" ]] ; then
diff --git a/tests/record.cpp b/tests/record.cpp
index a56f351..4457f93 100644
--- a/tests/record.cpp
+++ b/tests/record.cpp
@@ -153,9 +153,8 @@ int main( int argc, char *argv[] )
}
std::cout << "\nRecording for " << time << " seconds ... writing file 'record.raw' (buffer frames = " << bufferFrames << ")." << std::endl;
- while ( 1 ) {
+ while ( adc.isStreamRunning() ) {
SLEEP( 100 ); // wake every 100 ms to check if we're done
- if ( adc.isStreamRunning() == false ) break;
}
// Now write the entire data to the file.