Ticket #25: macjack.diff
| File macjack.diff, 24.8 KB (added by leland_lucius, 4 years ago) |
|---|
-
audacity/lib-src/portaudio-v19/configure.in
diff -wruN orig/audacity/lib-src/portaudio-v19/configure.in audacity/lib-src/portaudio-v19/configure.in
old new 136 136 dnl Mac OS X configuration 137 137 138 138 AC_DEFINE(PA_USE_COREAUDIO) 139 OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o ";139 OTHER_OBJS="src/os/mac_osx/pa_mac_hostapis.o src/os/unix/pa_unix_util.o src/hostapi/coreaudio/pa_mac_core.o src/hostapi/coreaudio/pa_mac_core_blocking.o src/hostapi/coreaudio/pa_mac_core_utilities.o pablio/ringbuffer.o"; 140 140 LIBS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon"; 141 141 PADLL="libportaudio.dylib"; 142 142 SHARED_FLAGS="-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -dynamiclib"; 143 CFLAGS="$CFLAGS -I\$(top_srcdir)/pablio" 144 143 145 if [[ $with_macapi = "asio" ]] ; then 144 146 if [[ $with_asiodir ]] ; then 145 147 ASIODIR="$with_asiodir"; … … 152 154 CFLAGS="$CFLAGS -I\$(top_srcdir)/pa_asio -I$ASIDIR/host/mac -I$ASIODIR/common"; 153 155 CXXFLAGS="$CFLAGS"; 154 156 fi 157 158 if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then 159 DLL_LIBS="$DLL_LIBS $JACK_LIBS" 160 CFLAGS="$CFLAGS $JACK_CFLAGS" 161 OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o pablio/ringbuffer.o" 162 AC_DEFINE(PA_USE_JACK) 163 fi 164 155 165 ;; 156 166 157 167 mingw* ) … … 271 281 if [[ $have_jack = "yes" ] && [ $with_jack != "no" ]] ; then 272 282 DLL_LIBS="$DLL_LIBS $JACK_LIBS" 273 283 CFLAGS="$CFLAGS $JACK_CFLAGS" 274 OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o "284 OTHER_OBJS="$OTHER_OBJS src/hostapi/jack/pa_jack.o pablio/ringbuffer.o" 275 285 AC_DEFINE(PA_USE_JACK) 276 286 fi 277 287 -
audacity/lib-src/portaudio-v19/pablio/ringbuffer.c
diff -wruN orig/audacity/lib-src/portaudio-v19/pablio/ringbuffer.c audacity/lib-src/portaudio-v19/pablio/ringbuffer.c
old new 1 1 /* 2 * $Id: ringbuffer.c,v 1. 4 2006/09/23 18:42:46llucius Exp $2 * $Id: ringbuffer.c,v 1.3 2006/09/23 18:42:49 llucius Exp $ 3 3 * ringbuffer.c 4 4 * Ring Buffer utility.. 5 5 * 6 6 * Author: Phil Burk, http://www.softsynth.com 7 * modified for SMP safety on Mac OS X by Bjorn Roche 8 * modified for SMP safety on Linux by Leland Lucius 9 * also, allowed for const where possible 10 * Note that this is safe only for a single-thread reader and a 11 * single-thread writer. 7 12 * 8 13 * This program uses the PortAudio Portable Audio Library. 9 14 * For more information see: http://www.portaudio.com … … 40 45 * license above. 41 46 */ 42 47 48 /** 49 @file 50 @ingroup hostapi_src 51 */ 52 43 53 #include <stdio.h> 44 54 #include <stdlib.h> 45 55 #include <math.h> 46 56 #include "ringbuffer.h" 47 57 #include <string.h> 48 58 59 /**************** 60 * First, we'll define some memory barrier primitives based on the system. 61 * right now only OS X, FreeBSD, and Linux are supported. In addition to providing 62 * memory barriers, these functions should ensure that data cached in registers 63 * is written out to cache where it can be snooped by other CPUs. (ie, the volatile 64 * keyword should not be required) 65 * 66 * the primitives that must be defined are: 67 * 68 * FullMemoryBarrier() 69 * ReadMemoryBarrier() 70 * WriteMemoryBarrier() 71 * 72 ****************/ 73 74 #if defined(__APPLE__) || defined(__FreeBSD__) 75 # include <libkern/OSAtomic.h> 76 /* Here are the memory barrier functions. Mac OS X and FreeBSD only provide 77 full memory barriers, so the three types of barriers are the same. 78 The asm volatile may be redundant with the memory barrier, but 79 until I have proof of that, I'm leaving it. */ 80 # define FullMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) 81 # define ReadMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) 82 # define WriteMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false) 83 # define MPSAFE 84 #elif defined(__linux__) 85 # include <asm/system.h> 86 /* Here are the memory barrier functions. */ 87 # define FullMemoryBarrier() do{ asm volatile("":::"memory"); smp_mb(); }while(false) 88 # define ReadMemoryBarrier() do{ asm volatile("":::"memory"); smp_rmb(); }while(false) 89 # define WriteMemoryBarrier() do{ asm volatile("":::"memory"); smp_wmb(); }while(false) 90 # define MPSAFE 91 #else 92 # warning Memory barriers not defined on this system or system unknown 93 #endif 94 49 95 /*************************************************************************** 50 96 * Initialize FIFO. 51 97 * numBytes must be power of 2, returns -1 if not. … … 64 110 ** Return number of bytes available for reading. */ 65 111 long RingBuffer_GetReadAvailable( RingBuffer *rbuf ) 66 112 { 113 #ifdef MPSAFE 114 ReadMemoryBarrier(); 115 #endif 67 116 return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask ); 68 117 } 69 118 /*************************************************************************** 70 119 ** Return number of bytes available for writing. */ 71 120 long RingBuffer_GetWriteAvailable( RingBuffer *rbuf ) 72 121 { 122 /* Since we are calling RingBuffer_GetReadAvailable, we don't need an aditional MB */ 73 123 return ( rbuf->bufferSize - RingBuffer_GetReadAvailable(rbuf)); 74 124 } 75 125 … … 119 169 */ 120 170 long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes ) 121 171 { 172 #ifdef MPSAFE 173 /* we need to ensure that previous writes are seen before we update the write index */ 174 WriteMemoryBarrier(); 122 175 return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; 176 #else 177 return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask; 178 #endif 123 179 } 124 180 125 181 /*************************************************************************** … … 159 215 */ 160 216 long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes ) 161 217 { 218 #ifdef MPSAFE 219 /* we need to ensure that previous writes are always seen before updating the index. */ 220 WriteMemoryBarrier(); 221 return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; 222 #else 162 223 return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask; 224 #endif 163 225 } 164 226 165 227 /*************************************************************************** 166 228 ** Return bytes written. */ 167 long RingBuffer_Write( RingBuffer *rbuf, void *data, long numBytes )229 long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes ) 168 230 { 169 231 long size1, size2, numWritten; 170 232 void *data1, *data2; -
audacity/lib-src/portaudio-v19/pablio/ringbuffer.h
diff -wruN orig/audacity/lib-src/portaudio-v19/pablio/ringbuffer.h audacity/lib-src/portaudio-v19/pablio/ringbuffer.h
old new 6 6 #endif /* __cplusplus */ 7 7 8 8 /* 9 * $Id: ringbuffer.h,v 1. 4 2006/09/23 18:42:46llucius Exp $9 * $Id: ringbuffer.h,v 1.3 2006/09/23 18:42:49 llucius Exp $ 10 10 * ringbuffer.h 11 11 * Ring Buffer utility.. 12 12 * 13 13 * Author: Phil Burk, http://www.softsynth.com 14 * modified for SMP safety on OS X by Bjorn Roche. 15 * also allowed for const where possible. 16 * Note that this is safe only for a single-thread reader 17 * and a single-thread writer. 14 18 * 15 19 * This program is distributed with the PortAudio Portable Audio Library. 16 20 * For more information see: http://www.portaudio.com … … 47 51 * license above. 48 52 */ 49 53 54 /** 55 @file 56 @ingroup hostapi_src 57 */ 58 50 59 #include <stdio.h> 51 60 #include <stdlib.h> 52 61 #include <math.h> … … 77 86 /* Return number of bytes available for read. */ 78 87 long RingBuffer_GetReadAvailable( RingBuffer *rbuf ); 79 88 /* Return bytes written. */ 80 long RingBuffer_Write( RingBuffer *rbuf, void *data, long numBytes );89 long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes ); 81 90 /* Return bytes read. */ 82 91 long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes ); 83 92 -
audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c
diff -wruN orig/audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.c
old new 1 /*2 * $Id: ringbuffer.c,v 1.3 2006/09/23 18:42:49 llucius Exp $3 * ringbuffer.c4 * Ring Buffer utility..5 *6 * Author: Phil Burk, http://www.softsynth.com7 * modified for SMP safety on Mac OS X by Bjorn Roche8 * also, alowed for const where possible9 * Note that this is safe only for a single-thread reader and a10 * single-thread writer.11 *12 * This program uses the PortAudio Portable Audio Library.13 * For more information see: http://www.portaudio.com14 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk15 *16 * Permission is hereby granted, free of charge, to any person obtaining17 * a copy of this software and associated documentation files18 * (the "Software"), to deal in the Software without restriction,19 * including without limitation the rights to use, copy, modify, merge,20 * publish, distribute, sublicense, and/or sell copies of the Software,21 * and to permit persons to whom the Software is furnished to do so,22 * subject to the following conditions:23 *24 * The above copyright notice and this permission notice shall be25 * included in all copies or substantial portions of the Software.26 *27 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,28 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF29 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.30 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR31 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF32 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION33 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.34 */35 36 /*37 * The text above constitutes the entire PortAudio license; however,38 * the PortAudio community also makes the following non-binding requests:39 *40 * Any person wishing to distribute modifications to the Software is41 * requested to send the modifications to the original developer so that42 * they can be incorporated into the canonical version. It is also43 * requested that these non-binding requests be included along with the44 * license above.45 */46 47 /**48 @file49 @ingroup hostapi_src50 */51 52 #include <stdio.h>53 #include <stdlib.h>54 #include <math.h>55 #include "ringbuffer.h"56 #include <string.h>57 58 /*59 * We can undefine this, to turn off memory barriers, but that60 * is only useful if we know we don't need to be MP safe or61 * we are interested in doing some kind of tests.62 */63 #define MPSAFE64 65 /****************66 * First, we'll define some memory barrier primitives based on the system.67 * right now only OS X and FreeBSD are supported. In addition to providing68 * memory barriers, these functions should ensure that data cached in registers69 * is written out to cache where it can be snooped by other CPUs. (ie, the volatile70 * keyword should not be required)71 *72 * the primitives that must be defined are:73 *74 * FullMemoryBarrier()75 * ReadMemoryBarrier()76 * WriteMemoryBarrier()77 *78 ****************/79 80 #if defined(__APPLE__) || defined(__FreeBSD__)81 # include <libkern/OSAtomic.h>82 /* Here are the memory barrier functions. Mac OS X and FreeBSD only provide83 full memory barriers, so the three types of barriers are the same.84 The asm volatile may be redundant with the memory barrier, but85 until I have proof of that, I'm leaving it. */86 # define FullMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false)87 # define ReadMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false)88 # define WriteMemoryBarrier() do{ asm volatile("":::"memory"); OSMemoryBarrier(); }while(false)89 #else90 # error Memory Barriers not defined on this system or system unknown91 #endif92 93 /***************************************************************************94 * Initialize FIFO.95 * numBytes must be power of 2, returns -1 if not.96 */97 long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr )98 {99 if( ((numBytes-1) & numBytes) != 0) return -1; /* Not Power of two. */100 rbuf->bufferSize = numBytes;101 rbuf->buffer = (char *)dataPtr;102 RingBuffer_Flush( rbuf );103 rbuf->bigMask = (numBytes*2)-1;104 rbuf->smallMask = (numBytes)-1;105 return 0;106 }107 /***************************************************************************108 ** Return number of bytes available for reading. */109 long RingBuffer_GetReadAvailable( RingBuffer *rbuf )110 {111 #ifdef MPSAFE112 ReadMemoryBarrier();113 #endif114 return ( (rbuf->writeIndex - rbuf->readIndex) & rbuf->bigMask );115 }116 /***************************************************************************117 ** Return number of bytes available for writing. */118 long RingBuffer_GetWriteAvailable( RingBuffer *rbuf )119 {120 /* Since we are calling RingBuffer_GetReadAvailable, we don't need an aditional MB */121 return ( rbuf->bufferSize - RingBuffer_GetReadAvailable(rbuf));122 }123 124 /***************************************************************************125 ** Clear buffer. Should only be called when buffer is NOT being read. */126 void RingBuffer_Flush( RingBuffer *rbuf )127 {128 rbuf->writeIndex = rbuf->readIndex = 0;129 }130 131 /***************************************************************************132 ** Get address of region(s) to which we can write data.133 ** If the region is contiguous, size2 will be zero.134 ** If non-contiguous, size2 will be the size of second region.135 ** Returns room available to be written or numBytes, whichever is smaller.136 */137 long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes,138 void **dataPtr1, long *sizePtr1,139 void **dataPtr2, long *sizePtr2 )140 {141 long index;142 long available = RingBuffer_GetWriteAvailable( rbuf );143 if( numBytes > available ) numBytes = available;144 /* Check to see if write is not contiguous. */145 index = rbuf->writeIndex & rbuf->smallMask;146 if( (index + numBytes) > rbuf->bufferSize )147 {148 /* Write data in two blocks that wrap the buffer. */149 long firstHalf = rbuf->bufferSize - index;150 *dataPtr1 = &rbuf->buffer[index];151 *sizePtr1 = firstHalf;152 *dataPtr2 = &rbuf->buffer[0];153 *sizePtr2 = numBytes - firstHalf;154 }155 else156 {157 *dataPtr1 = &rbuf->buffer[index];158 *sizePtr1 = numBytes;159 *dataPtr2 = NULL;160 *sizePtr2 = 0;161 }162 return numBytes;163 }164 165 166 /***************************************************************************167 */168 long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes )169 {170 #ifdef MPSAFE171 /* we need to ensure that previous writes are seen before we update the write index */172 WriteMemoryBarrier();173 return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask;174 #else175 return rbuf->writeIndex = (rbuf->writeIndex + numBytes) & rbuf->bigMask;176 #endif177 }178 179 /***************************************************************************180 ** Get address of region(s) from which we can read data.181 ** If the region is contiguous, size2 will be zero.182 ** If non-contiguous, size2 will be the size of second region.183 ** Returns room available to be written or numBytes, whichever is smaller.184 */185 long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes,186 void **dataPtr1, long *sizePtr1,187 void **dataPtr2, long *sizePtr2 )188 {189 long index;190 long available = RingBuffer_GetReadAvailable( rbuf );191 if( numBytes > available ) numBytes = available;192 /* Check to see if read is not contiguous. */193 index = rbuf->readIndex & rbuf->smallMask;194 if( (index + numBytes) > rbuf->bufferSize )195 {196 /* Write data in two blocks that wrap the buffer. */197 long firstHalf = rbuf->bufferSize - index;198 *dataPtr1 = &rbuf->buffer[index];199 *sizePtr1 = firstHalf;200 *dataPtr2 = &rbuf->buffer[0];201 *sizePtr2 = numBytes - firstHalf;202 }203 else204 {205 *dataPtr1 = &rbuf->buffer[index];206 *sizePtr1 = numBytes;207 *dataPtr2 = NULL;208 *sizePtr2 = 0;209 }210 return numBytes;211 }212 /***************************************************************************213 */214 long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes )215 {216 #ifdef MPSAFE217 /* we need to ensure that previous writes are always seen before updating the index. */218 WriteMemoryBarrier();219 return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask;220 #else221 return rbuf->readIndex = (rbuf->readIndex + numBytes) & rbuf->bigMask;222 #endif223 }224 225 /***************************************************************************226 ** Return bytes written. */227 long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes )228 {229 long size1, size2, numWritten;230 void *data1, *data2;231 numWritten = RingBuffer_GetWriteRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 );232 if( size2 > 0 )233 {234 235 memcpy( data1, data, size1 );236 data = ((char *)data) + size1;237 memcpy( data2, data, size2 );238 }239 else240 {241 memcpy( data1, data, size1 );242 }243 RingBuffer_AdvanceWriteIndex( rbuf, numWritten );244 return numWritten;245 }246 247 /***************************************************************************248 ** Return bytes read. */249 long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes )250 {251 long size1, size2, numRead;252 void *data1, *data2;253 numRead = RingBuffer_GetReadRegions( rbuf, numBytes, &data1, &size1, &data2, &size2 );254 if( size2 > 0 )255 {256 memcpy( data, data1, size1 );257 data = ((char *)data) + size1;258 memcpy( data, data2, size2 );259 }260 else261 {262 memcpy( data, data1, size1 );263 }264 RingBuffer_AdvanceReadIndex( rbuf, numRead );265 return numRead;266 } -
audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h
diff -wruN orig/audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h audacity/lib-src/portaudio-v19/src/hostapi/coreaudio/ringbuffer.h
old new 1 #ifndef _RINGBUFFER_H2 #define _RINGBUFFER_H3 #ifdef __cplusplus4 extern "C"5 {6 #endif /* __cplusplus */7 8 /*9 * $Id: ringbuffer.h,v 1.3 2006/09/23 18:42:49 llucius Exp $10 * ringbuffer.h11 * Ring Buffer utility..12 *13 * Author: Phil Burk, http://www.softsynth.com14 * modified for SMP safety on OS X by Bjorn Roche.15 * also allowed for const where possible.16 * Note that this is safe only for a single-thread reader17 * and a single-thread writer.18 *19 * This program is distributed with the PortAudio Portable Audio Library.20 * For more information see: http://www.portaudio.com21 * Copyright (c) 1999-2000 Ross Bencina and Phil Burk22 *23 * Permission is hereby granted, free of charge, to any person obtaining24 * a copy of this software and associated documentation files25 * (the "Software"), to deal in the Software without restriction,26 * including without limitation the rights to use, copy, modify, merge,27 * publish, distribute, sublicense, and/or sell copies of the Software,28 * and to permit persons to whom the Software is furnished to do so,29 * subject to the following conditions:30 *31 * The above copyright notice and this permission notice shall be32 * included in all copies or substantial portions of the Software.33 *34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,35 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF36 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.37 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR38 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF39 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION40 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.41 */42 43 /*44 * The text above constitutes the entire PortAudio license; however,45 * the PortAudio community also makes the following non-binding requests:46 *47 * Any person wishing to distribute modifications to the Software is48 * requested to send the modifications to the original developer so that49 * they can be incorporated into the canonical version. It is also50 * requested that these non-binding requests be included along with the51 * license above.52 */53 54 /**55 @file56 @ingroup hostapi_src57 */58 59 #include <stdio.h>60 #include <stdlib.h>61 #include <math.h>62 #include "ringbuffer.h"63 #include <string.h>64 65 typedef struct66 {67 long bufferSize; /* Number of bytes in FIFO. Power of 2. Set by RingBuffer_Init. */68 long writeIndex; /* Index of next writable byte. Set by RingBuffer_AdvanceWriteIndex. */69 long readIndex; /* Index of next readable byte. Set by RingBuffer_AdvanceReadIndex. */70 long bigMask; /* Used for wrapping indices with extra bit to distinguish full/empty. */71 long smallMask; /* Used for fitting indices to buffer. */72 char * buffer;73 }74 RingBuffer;75 /*76 * Initialize Ring Buffer.77 * numBytes must be power of 2, returns -1 if not.78 */79 long RingBuffer_Init( RingBuffer *rbuf, long numBytes, void *dataPtr );80 81 /* Clear buffer. Should only be called when buffer is NOT being read. */82 void RingBuffer_Flush( RingBuffer *rbuf );83 84 /* Return number of bytes available for writing. */85 long RingBuffer_GetWriteAvailable( RingBuffer *rbuf );86 /* Return number of bytes available for read. */87 long RingBuffer_GetReadAvailable( RingBuffer *rbuf );88 /* Return bytes written. */89 long RingBuffer_Write( RingBuffer *rbuf, const void *data, long numBytes );90 /* Return bytes read. */91 long RingBuffer_Read( RingBuffer *rbuf, void *data, long numBytes );92 93 /* Get address of region(s) to which we can write data.94 ** If the region is contiguous, size2 will be zero.95 ** If non-contiguous, size2 will be the size of second region.96 ** Returns room available to be written or numBytes, whichever is smaller.97 */98 long RingBuffer_GetWriteRegions( RingBuffer *rbuf, long numBytes,99 void **dataPtr1, long *sizePtr1,100 void **dataPtr2, long *sizePtr2 );101 long RingBuffer_AdvanceWriteIndex( RingBuffer *rbuf, long numBytes );102 103 /* Get address of region(s) from which we can read data.104 ** If the region is contiguous, size2 will be zero.105 ** If non-contiguous, size2 will be the size of second region.106 ** Returns room available to be written or numBytes, whichever is smaller.107 */108 long RingBuffer_GetReadRegions( RingBuffer *rbuf, long numBytes,109 void **dataPtr1, long *sizePtr1,110 void **dataPtr2, long *sizePtr2 );111 112 long RingBuffer_AdvanceReadIndex( RingBuffer *rbuf, long numBytes );113 114 #ifdef __cplusplus115 }116 #endif /* __cplusplus */117 #endif /* _RINGBUFFER_H */ -
audacity/lib-src/portaudio-v19/src/hostapi/jack/pa_jack.c
diff -wruN orig/audacity/lib-src/portaudio-v19/src/hostapi/jack/pa_jack.c audacity/lib-src/portaudio-v19/src/hostapi/jack/pa_jack.c
old new 68 68 #include "pa_process.h" 69 69 #include "pa_allocation.h" 70 70 #include "pa_cpuload.h" 71 #include " ../pablio/ringbuffer.c"71 #include "ringbuffer.h" 72 72 73 73 static int aErr_; 74 74 static PaError paErr_; /* For use with ENSURE_PA */ … … 466 466 467 467 const char **jack_ports = NULL; 468 468 char **client_names = NULL; 469 char *regex_pattern = MALLOC( jack_client_name_size() + 3 );469 char *regex_pattern = NULL; 470 470 int port_index, client_index, i; 471 471 double globalSampleRate; 472 472 regex_t port_regex; 473 473 unsigned long numClients = 0, numPorts = 0; 474 char *tmp_client_name = MALLOC( jack_client_name_size() );474 char *tmp_client_name = NULL; 475 475 476 476 commonApi->info.defaultInputDevice = paNoDevice; 477 477 commonApi->info.defaultOutputDevice = paNoDevice; … … 484 484 * associated with the previous list */ 485 485 PaUtil_FreeAllAllocations( jackApi->deviceInfoMemory ); 486 486 487 regex_pattern = MALLOC( jack_client_name_size() + 3 ); 488 tmp_client_name = MALLOC( jack_client_name_size() ); 489 487 490 /* We can only retrieve the list of clients indirectly, by first 488 491 * asking for a list of all ports, then parsing the port names 489 492 * according to the client_name:port_name convention (which is
