diff options
| author | Gary Scavone <gary@music.mcgill.ca> | 2019-08-27 20:31:50 -0400 |
|---|---|---|
| committer | Gary Scavone <gary@music.mcgill.ca> | 2019-08-27 20:31:50 -0400 |
| commit | 1b570c8b2d87743f056f7250569f0e2808170e1c (patch) | |
| tree | 0205a4c5d87fa9428bee9798ef2d10e079625342 | |
| parent | 5d3d33bc462d7160cfe27f96ffba240ee82340c0 (diff) | |
Fix to CoreAudio update for deprecated behaviour.
| -rw-r--r-- | RtAudio.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/RtAudio.cpp b/RtAudio.cpp index 9576d16..1108c74 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -1478,13 +1478,14 @@ void RtApiCore :: closeStream( void ) errorText_ = "RtApiCore::closeStream(): error removing property listener!"; error( RtAudioError::WARNING ); } - } - if ( stream_.state == STREAM_RUNNING ) { + #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) - AudioDeviceStop( handle->id[0], handle->procId[0] ); + if ( stream_.state == STREAM_RUNNING ) + AudioDeviceStop( handle->id[0], handle->procId[0] ); AudioDeviceDestroyIOProcID( handle->id[0], handle->procId[0] ); #else // deprecated behaviour - AudioDeviceStop( handle->id[0], callbackHandler ); + if ( stream_.state == STREAM_RUNNING ) + AudioDeviceStop( handle->id[0], callbackHandler ); AudioDeviceRemoveIOProc( handle->id[0], callbackHandler ); #endif } @@ -1502,13 +1503,14 @@ void RtApiCore :: closeStream( void ) errorText_ = "RtApiCore::closeStream(): error removing property listener!"; error( RtAudioError::WARNING ); } - } - if ( stream_.state == STREAM_RUNNING ) { + #if defined( MAC_OS_X_VERSION_10_5 ) && ( MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 ) - AudioDeviceStop( handle->id[1], handle->procId[1] ); + if ( stream_.state == STREAM_RUNNING ) + AudioDeviceStop( handle->id[1], handle->procId[1] ); AudioDeviceDestroyIOProcID( handle->id[1], handle->procId[1] ); #else // deprecated behaviour - AudioDeviceStop( handle->id[1], callbackHandler ); + if ( stream_.state == STREAM_RUNNING ) + AudioDeviceStop( handle->id[1], callbackHandler ); AudioDeviceRemoveIOProc( handle->id[1], callbackHandler ); #endif } |
