Fix jackXrun handle pointer
authorStephen Sinclair <radarsat1@gmail.com>
Mon, 20 Nov 2017 23:37:49 +0000 (20:37 -0300)
committerStephen Sinclair <radarsat1@gmail.com>
Mon, 20 Nov 2017 23:39:10 +0000 (20:39 -0300)
Thanks github user @bontric, closes #113.

RtAudio.cpp

index 111039404af9339ab508a4efcfda6458788c6d33..2ac217965462a166d6b9516ec06726f90c394446 100644 (file)
@@ -2130,7 +2130,7 @@ static void jackShutdown( void *infoPointer )
 
 static int jackXrun( void *infoPointer )
 {
-  JackHandle *handle = (JackHandle *) infoPointer;
+  JackHandle *handle = *((JackHandle **) infoPointer);
 
   if ( handle->ports[0] ) handle->xrun[0] = true;
   if ( handle->ports[1] ) handle->xrun[1] = true;
@@ -2334,7 +2334,7 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne
   else {
     stream_.mode = mode;
     jack_set_process_callback( handle->client, jackCallbackHandler, (void *) &stream_.callbackInfo );
-    jack_set_xrun_callback( handle->client, jackXrun, (void *) &handle );
+    jack_set_xrun_callback( handle->client, jackXrun, (void *) &stream_.apiHandle );
     jack_on_shutdown( handle->client, jackShutdown, (void *) &stream_.callbackInfo );
   }