Browse Source

Added clearing of input user buffer in stopStream for OS-X, in case stream is restarted.

noexceptions
Gary Scavone 7 years ago
parent
commit
dfadcff5c9
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      RtAudio.cpp

+ 6
- 1
RtAudio.cpp View File

@@ -1656,7 +1656,12 @@ void RtApiCore :: stopStream( void )

stream_.state = STREAM_STOPPED;
// set stream time to zero?
// and perhaps clear input user or device buffers?
// Clear user input buffer in case the stream is restarted
if ( stream_.mode == INPUT || stream_.mode == DUPLEX ) {
unsigned long bufferBytes;
bufferBytes = stream_.nUserChannels[1] * stream_.bufferSize * formatBytes( stream_.userFormat );
memset( stream_.userBuffer[1], 0, bufferBytes * sizeof(char) );
}

unlock:
if ( result == noErr ) return;


Loading…
Cancel
Save