diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2014-03-31 16:46:04 -0400 |
|---|---|---|
| committer | Gary Scavone <gary@music.mcgill.ca> | 2014-03-31 16:46:04 -0400 |
| commit | a71027332b636913443e66f6af4566dd86983f24 (patch) | |
| tree | 5441e537b9708184bcb637b0ee7bd93c42b0d865 /RtAudio.cpp | |
| parent | 12516be654cafb0f681174d1fd99b5f61e254307 (diff) | |
Fix for ALSA runnable flag update mistake; moved streamname declaration in PULSE code to avoid compiler complaint.
Diffstat (limited to 'RtAudio.cpp')
| -rw-r--r-- | RtAudio.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index efed868..7d60e77 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -180,14 +180,15 @@ RtAudio :: RtAudio( RtAudio::Api api ) throw() // It should not be possible to get here because the preprocessor
// definition __RTAUDIO_DUMMY__ is automatically defined if no
// API-specific definitions are passed to the compiler. But just in
- // case something weird happens, we'll print out an error message.
+ // case something weird happens, we'll thow an error.
std::string errorText = "\nRtAudio: no compiled API support found ... critical error!!\n\n";
throw( RtAudioError( errorText, RtAudioError::UNSPECIFIED ) );
}
RtAudio :: ~RtAudio() throw()
{
- delete rtapi_;
+ if ( rtapi_ )
+ delete rtapi_;
}
void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters,
@@ -6143,7 +6144,6 @@ void RtApiAlsa :: startStream() stream_.state = STREAM_RUNNING;
unlock:
- apiInfo->runnable = false; // fixes high CPU usage when stopped
pthread_cond_signal( &apiInfo->runnable_cv );
MUTEX_UNLOCK( &stream_.mutex );
@@ -6229,6 +6229,7 @@ void RtApiAlsa :: abortStream() }
unlock:
+ apiInfo->runnable = false; // fixes high CPU usage when stopped
MUTEX_UNLOCK( &stream_.mutex );
if ( result >= 0 ) return;
@@ -6804,6 +6805,7 @@ bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode, stream_.nUserChannels[mode] = channels;
stream_.nDeviceChannels[mode] = channels + firstChannel;
stream_.channelOffset[mode] = 0;
+ std::string streamName = "RtAudio";
// Allocate necessary internal buffers.
bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat );
@@ -6857,7 +6859,6 @@ bool RtApiPulse::probeDeviceOpen( unsigned int device, StreamMode mode, pah = static_cast<PulseAudioHandle *>( stream_.apiHandle );
int error;
- std::string streamName = "RtAudio";
if ( !options->streamName.empty() ) streamName = options->streamName;
switch ( mode ) {
case INPUT:
|
