[PD-cvs] pd/portaudio/pa_common pa_converters.c, 1.9, 1.10 pa_dither.c, 1.9, 1.10 pa_endianness.h, 1.9, 1.10 pa_front.c, 1.9, 1.10 pa_process.c, 1.9, 1.10 pa_trace.c, 1.9, 1.10 pa_util.h, 1.9, 1.10 portaudio.h, 1.9, 1.10

Miller Puckette millerpuckette at users.sourceforge.net
Sat Jun 3 21:13:08 CEST 2006


Update of /cvsroot/pure-data/pd/portaudio/pa_common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12672/pd/portaudio/pa_common

Modified Files:
	pa_converters.c pa_dither.c pa_endianness.h pa_front.c 
	pa_process.c pa_trace.c pa_util.h portaudio.h 
Log Message:
FFT package selection

Zmoelnig's multi-'$' patch

big-soundfile support

Patch to set open directories (openpanel, savepanel)

patch to allow funny characters in extern names

fixed makefile.in to support intel mac






Index: pa_endianness.h
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_endianness.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_endianness.h	30 May 2005 03:04:08 -0000	1.9
--- pa_endianness.h	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 68,76 ****
      /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */
  
!     #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
  
      #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */
  
      #else
  
  #endif
--- 68,78 ----
      /* set PA_LITTLE_ENDIAN or PA_BIG_ENDIAN by testing well known platform specific defines */
  
!     #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(LITTLE_ENDIAN) || defined(__i386) || defined(_M_IX86)
  
      #define PA_LITTLE_ENDIAN /* win32, assume intel byte order */
  
      #else
+ 		
+ 		 #define PA_BIG_ENDIAN
  
  #endif

Index: portaudio.h
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/portaudio.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** portaudio.h	30 May 2005 03:04:09 -0000	1.9
--- portaudio.h	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 93,97 ****
      paCanNotReadFromAnOutputOnlyStream,   /**< @todo review error code name */
      paCanNotWriteToAnInputOnlyStream,     /**< @todo review error code name */
!     paIncompatibleStreamHostApi
  } PaErrorCode;
  
--- 93,98 ----
      paCanNotReadFromAnOutputOnlyStream,   /**< @todo review error code name */
      paCanNotWriteToAnInputOnlyStream,     /**< @todo review error code name */
!     paIncompatibleStreamHostApi,
!     paBadBufferPtr
  } PaErrorCode;
  
***************
*** 248,252 ****
      int deviceCount;
  
!     /** The the default input device for this host API. The value will be a
       device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
       if no default input device is available.
--- 249,253 ----
      int deviceCount;
  
!     /** The default input device for this host API. The value will be a
       device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
       if no default input device is available.
***************
*** 254,258 ****
      PaDeviceIndex defaultInputDevice;
  
!     /** The the default output device for this host API. The value will be a
       device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
       if no default output device is available.
--- 255,259 ----
      PaDeviceIndex defaultInputDevice;
  
!     /** The default output device for this host API. The value will be a
       device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice
       if no default output device is available.
***************
*** 497,502 ****
       choose the closest viable latency instead. Unless the suggested latency
       is greater than the absolute upper limit for the device implementations
!      shouldround the suggestedLatency up to the next practial value - ie to
!      provide an equal or higher latency than suggestedLatency whereever possibe.
       Actual latency values for an open stream may be retrieved using the
       inputLatency and outputLatency fields of the PaStreamInfo structure
--- 498,503 ----
       choose the closest viable latency instead. Unless the suggested latency
       is greater than the absolute upper limit for the device implementations
!      should round the suggestedLatency up to the next practial value - ie to
!      provide an equal or higher latency than suggestedLatency wherever possibe.
       Actual latency values for an open stream may be retrieved using the
       inputLatency and outputLatency fields of the PaStreamInfo structure

Index: pa_converters.c
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_converters.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_converters.c	30 May 2005 03:04:08 -0000	1.9
--- pa_converters.c	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 326,330 ****
  {
      float *src = (float*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 326,330 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 337,341 ****
  #else
          double scaled = *src * 0x7FFFFFFF;
!         *dest = (signed long) scaled;        
  #endif
          
--- 337,341 ----
  #else
          double scaled = *src * 0x7FFFFFFF;
!         *dest = (PaInt32) scaled;        
  #endif
          
***************
*** 353,357 ****
  {
      float *src = (float*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
  
      while( count-- )
--- 353,357 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
  
      while( count-- )
***************
*** 367,371 ****
          /* use smaller scaler to prevent overflow when we add the dither */
          double dithered = ((double)*src * (2147483646.0)) + dither;
!         *dest = (signed long) dithered;
  #endif
          src += sourceStride;
--- 367,371 ----
          /* use smaller scaler to prevent overflow when we add the dither */
          double dithered = ((double)*src * (2147483646.0)) + dither;
!         *dest = (PaInt32) dithered;
  #endif
          src += sourceStride;
***************
*** 382,386 ****
  {
      float *src = (float*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
      (void) ditherGenerator; /* unused parameter */
      
--- 382,386 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
      (void) ditherGenerator; /* unused parameter */
      
***************
*** 395,399 ****
          double scaled = *src * 0x7FFFFFFF;
          PA_CLIP_( scaled, -2147483648., 2147483647.  );
!         *dest = (signed long) scaled;
  #endif
  
--- 395,399 ----
          double scaled = *src * 0x7FFFFFFF;
          PA_CLIP_( scaled, -2147483648., 2147483647.  );
!         *dest = (PaInt32) scaled;
  #endif
  
***************
*** 411,415 ****
  {
      float *src = (float*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
  
      while( count-- )
--- 411,415 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
  
      while( count-- )
***************
*** 427,431 ****
          double dithered = ((double)*src * (2147483646.0)) + dither;
          PA_CLIP_( dithered, -2147483648., 2147483647.  );
!         *dest = (signed long) dithered;
  #endif
  
--- 427,431 ----
          double dithered = ((double)*src * (2147483646.0)) + dither;
          PA_CLIP_( dithered, -2147483648., 2147483647.  );
!         *dest = (PaInt32) dithered;
  #endif
  
***************
*** 444,448 ****
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     signed long temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 444,448 ----
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     PaInt32 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 452,456 ****
          /* convert to 32 bit and drop the low 8 bits */
          double scaled = *src * 0x7FFFFFFF;
!         temp = (signed long) scaled;
          
  #if defined(PA_LITTLE_ENDIAN)
--- 452,456 ----
          /* convert to 32 bit and drop the low 8 bits */
          double scaled = *src * 0x7FFFFFFF;
!         temp = (PaInt32) scaled;
          
  #if defined(PA_LITTLE_ENDIAN)
***************
*** 478,482 ****
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     signed long temp;
  
      while( count-- )
--- 478,482 ----
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     PaInt32 temp;
  
      while( count-- )
***************
*** 488,492 ****
          double dithered = ((double)*src * (2147483646.0)) + dither;
          
!         temp = (signed long) dithered;
  
  #if defined(PA_LITTLE_ENDIAN)
--- 488,492 ----
          double dithered = ((double)*src * (2147483646.0)) + dither;
          
!         temp = (PaInt32) dithered;
  
  #if defined(PA_LITTLE_ENDIAN)
***************
*** 514,518 ****
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     signed long temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 514,518 ----
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     PaInt32 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 523,527 ****
          double scaled = *src * 0x7FFFFFFF;
          PA_CLIP_( scaled, -2147483648., 2147483647.  );
!         temp = (signed long) scaled;
  
  #if defined(PA_LITTLE_ENDIAN)
--- 523,527 ----
          double scaled = *src * 0x7FFFFFFF;
          PA_CLIP_( scaled, -2147483648., 2147483647.  );
!         temp = (PaInt32) scaled;
  
  #if defined(PA_LITTLE_ENDIAN)
***************
*** 549,553 ****
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     signed long temp;
      
      while( count-- )
--- 549,553 ----
      float *src = (float*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     PaInt32 temp;
      
      while( count-- )
***************
*** 560,564 ****
          PA_CLIP_( dithered, -2147483648., 2147483647.  );
          
!         temp = (signed long) dithered;
  
  #if defined(PA_LITTLE_ENDIAN)
--- 560,564 ----
          PA_CLIP_( dithered, -2147483648., 2147483647.  );
          
!         temp = (PaInt32) dithered;
  
  #if defined(PA_LITTLE_ENDIAN)
***************
*** 585,589 ****
  {
      float *src = (float*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 585,589 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 611,615 ****
  {
      float *src = (float*)sourceBuffer;
!     signed short *dest = (signed short*)destinationBuffer;
  
      while( count-- )
--- 611,615 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt16 *dest = (PaInt16*)destinationBuffer;
  
      while( count-- )
***************
*** 623,627 ****
          *dest = lrintf(dithered-0.5f);
  #else
!         *dest = (signed short) dithered;
  #endif
  
--- 623,627 ----
          *dest = lrintf(dithered-0.5f);
  #else
!         *dest = (PaInt16) dithered;
  #endif
  
***************
*** 639,643 ****
  {
      float *src = (float*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 639,643 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 647,654 ****
          long samp = lrintf((*src * (32767.0f)) -0.5f);
  #else
!         long samp = (signed long) (*src * (32767.0f));
  #endif
          PA_CLIP_( samp, -0x8000, 0x7FFF );
!         *dest = (signed short) samp;
  
          src += sourceStride;
--- 647,654 ----
          long samp = lrintf((*src * (32767.0f)) -0.5f);
  #else
!         long samp = (PaInt32) (*src * (32767.0f));
  #endif
          PA_CLIP_( samp, -0x8000, 0x7FFF );
!         *dest = (PaInt16) samp;
  
          src += sourceStride;
***************
*** 665,669 ****
  {
      float *src = (float*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 665,669 ----
  {
      float *src = (float*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 674,683 ****
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (32766.0f)) + dither;
!         signed long samp = (signed long) dithered;
          PA_CLIP_( samp, -0x8000, 0x7FFF );
  #ifdef PA_USE_C99_LRINTF
          *dest = lrintf(samp-0.5f);
  #else
!         *dest = (signed short) samp;
  #endif
  
--- 674,683 ----
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (32766.0f)) + dither;
!         PaInt32 samp = (PaInt32) dithered;
          PA_CLIP_( samp, -0x8000, 0x7FFF );
  #ifdef PA_USE_C99_LRINTF
          *dest = lrintf(samp-0.5f);
  #else
!         *dest = (PaInt16) samp;
  #endif
  
***************
*** 724,728 ****
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (126.0f)) + dither;
!         signed long samp = (signed long) dithered;
          *dest = (signed char) samp;
  
--- 724,728 ----
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (126.0f)) + dither;
!         PaInt32 samp = (PaInt32) dithered;
          *dest = (signed char) samp;
  
***************
*** 745,749 ****
      while( count-- )
      {
!         signed long samp = (signed long)(*src * (127.0f));
          PA_CLIP_( samp, -0x80, 0x7F );
          *dest = (signed char) samp;
--- 745,749 ----
      while( count-- )
      {
!         PaInt32 samp = (PaInt32)(*src * (127.0f));
          PA_CLIP_( samp, -0x80, 0x7F );
          *dest = (signed char) samp;
***************
*** 770,774 ****
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (126.0f)) + dither;
!         signed long samp = (signed long) dithered;
          PA_CLIP_( samp, -0x80, 0x7F );
          *dest = (signed char) samp;
--- 770,774 ----
          /* use smaller scaler to prevent overflow when we add the dither */
          float dithered = (*src * (126.0f)) + dither;
!         PaInt32 samp = (PaInt32) dithered;
          PA_CLIP_( samp, -0x80, 0x7F );
          *dest = (signed char) samp;
***************
*** 867,871 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
      float *dest =  (float*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 867,871 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
      float *dest =  (float*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 887,891 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src    = (signed long*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
      (void) ditherGenerator; /* unused parameter */
--- 887,891 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src    = (PaInt32*)sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
      (void) ditherGenerator; /* unused parameter */
***************
*** 931,941 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
!         *dest = (signed short) ((*src) >> 16);
  
          src += sourceStride;
--- 931,941 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
!         *dest = (PaInt16) ((*src) >> 16);
  
          src += sourceStride;
***************
*** 951,957 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
!     signed long dither;
  
      while( count-- )
--- 951,957 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
!     PaInt32 dither;
  
      while( count-- )
***************
*** 959,963 ****
          /* REVIEW */
          dither = PaUtil_Generate16BitTriangularDither( ditherGenerator );
!         *dest = (signed short) ((((*src)>>1) + dither) >> 15);
  
          src += sourceStride;
--- 959,963 ----
          /* REVIEW */
          dither = PaUtil_Generate16BitTriangularDither( ditherGenerator );
!         *dest = (PaInt16) ((((*src)>>1) + dither) >> 15);
  
          src += sourceStride;
***************
*** 973,977 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 973,977 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 993,999 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
!     signed long dither;
  
      while( count-- )
--- 993,999 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
!     PaInt32 dither;
  
      while( count-- )
***************
*** 1015,1019 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1015,1019 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1035,1039 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed long *src = (signed long*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1035,1039 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt32 *src = (PaInt32*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1057,1061 ****
      unsigned char *src = (unsigned char*)sourceBuffer;
      float *dest = (float*)destinationBuffer;
!     signed long temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 1057,1061 ----
      unsigned char *src = (unsigned char*)sourceBuffer;
      float *dest = (float*)destinationBuffer;
!     PaInt32 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 1089,1094 ****
  {
      unsigned char *src  = (unsigned char*)sourceBuffer;
!     signed long   *dest = (signed long*)  destinationBuffer;
!     signed long temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 1089,1094 ----
  {
      unsigned char *src  = (unsigned char*)sourceBuffer;
!     PaInt32 *dest = (PaInt32*)  destinationBuffer;
!     PaInt32 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 1122,1128 ****
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     signed short *dest = (signed short*)destinationBuffer;
      
! 	signed short temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 1122,1128 ----
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     PaInt16 *dest = (PaInt16*)destinationBuffer;
      
!     PaInt16 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 1133,1142 ****
  #if defined(PA_LITTLE_ENDIAN)
  		/* src[0] is discarded */
!         temp = (((signed short)src[1]));
!         temp = temp | (signed short)(((signed short)src[2]) << 8);
  #elif defined(PA_BIG_ENDIAN)
  		/* src[2] is discarded */
!         temp = (signed short)(((signed short)src[0]) << 8);
!         temp = temp | (((signed short)src[1]));
  #endif
  
--- 1133,1142 ----
  #if defined(PA_LITTLE_ENDIAN)
  		/* src[0] is discarded */
!         temp = (((PaInt16)src[1]));
!         temp = temp | (PaInt16)(((PaInt16)src[2]) << 8);
  #elif defined(PA_BIG_ENDIAN)
  		/* src[2] is discarded */
!         temp = (PaInt16)(((PaInt16)src[0]) << 8);
!         temp = temp | (((PaInt16)src[1]));
  #endif
  
***************
*** 1263,1267 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
      float *dest =  (float*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1263,1267 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
      float *dest =  (float*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1284,1289 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 1284,1289 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 1308,1314 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src   = (signed short*) sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     signed short temp;
  
      (void) ditherGenerator; /* unused parameter */
--- 1308,1314 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src   = (PaInt16*) sourceBuffer;
      unsigned char *dest = (unsigned char*)destinationBuffer;
!     PaInt16 temp;
  
      (void) ditherGenerator; /* unused parameter */
***************
*** 1340,1344 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1340,1344 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1360,1364 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1360,1364 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
      signed char *dest =  (signed char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1380,1384 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1380,1384 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1400,1404 ****
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     signed short *src = (signed short*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
--- 1400,1404 ----
      unsigned int count, struct PaUtilTriangularDitherGenerator *ditherGenerator )
  {
!     PaInt16 *src = (PaInt16*)sourceBuffer;
      unsigned char *dest =  (unsigned char*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
***************
*** 1442,1446 ****
  {
      signed char *src = (signed char*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 1442,1446 ----
  {
      signed char *src = (signed char*)sourceBuffer;
!     PaInt32 *dest =  (PaInt32*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 1491,1500 ****
  {
      signed char *src = (signed char*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
! 		(*dest) = (signed short)((*src) << 8);
  
          src += sourceStride;
--- 1491,1500 ----
  {
      signed char *src = (signed char*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
!         (*dest) = (PaInt16)((*src) << 8);
  
          src += sourceStride;
***************
*** 1552,1556 ****
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     signed long *dest =  (signed long*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
--- 1552,1556 ----
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     PaInt32 *dest = (PaInt32*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
***************
*** 1601,1610 ****
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     signed short *dest =  (signed short*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
! 		(*dest) = (signed short)((*src - 128) << 8);
  
          src += sourceStride;
--- 1601,1610 ----
  {
      unsigned char *src = (unsigned char*)sourceBuffer;
!     PaInt16 *dest =  (PaInt16*)destinationBuffer;
      (void)ditherGenerator; /* unused parameter */
  
      while( count-- )
      {
!         (*dest) = (PaInt16)((*src - 128) << 8);
  
          src += sourceStride;

Index: pa_util.h
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_util.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_util.h	30 May 2005 03:04:09 -0000	1.9
--- pa_util.h	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 115,119 ****
  void PaUtil_DebugPrint( const char *format, ... );
  
! #if (0) /* set to 1 to print debug messages */
  #define PA_DEBUG(x) PaUtil_DebugPrint x ;
  #else
--- 115,119 ----
  void PaUtil_DebugPrint( const char *format, ... );
  
! #ifdef PA_ENABLE_DEBUG_OUTPUT
  #define PA_DEBUG(x) PaUtil_DebugPrint x ;
  #else

Index: pa_dither.c
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_dither.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_dither.c	30 May 2005 03:04:08 -0000	1.9
--- pa_dither.c	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 36,39 ****
--- 36,40 ----
  
  #include "pa_dither.h"
+ #include "pa_types.h"
  
  #define PA_DITHER_BITS_   (15)
***************
*** 60,64 ****
       * Also shift an extra bit for the high pass filter. 
       */
! #define DITHER_SHIFT_  ((32 - PA_DITHER_BITS_) + 1)
      current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
                (((signed long)state->randSeed2)>>DITHER_SHIFT_);
--- 61,65 ----
       * Also shift an extra bit for the high pass filter. 
       */
! #define DITHER_SHIFT_  ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1)
      current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
                (((signed long)state->randSeed2)>>DITHER_SHIFT_);
***************
*** 87,91 ****
       * Also shift an extra bit for the high pass filter. 
       */
! #define DITHER_SHIFT_  ((32 - PA_DITHER_BITS_) + 1)
      current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
                (((signed long)state->randSeed2)>>DITHER_SHIFT_);
--- 88,92 ----
       * Also shift an extra bit for the high pass filter. 
       */
! #define DITHER_SHIFT_  ((SIZEOF_LONG*8 - PA_DITHER_BITS_) + 1)
      current = (((signed long)state->randSeed1)>>DITHER_SHIFT_) +
                (((signed long)state->randSeed2)>>DITHER_SHIFT_);

Index: pa_trace.c
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_trace.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_trace.c	30 May 2005 03:04:08 -0000	1.9
--- pa_trace.c	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 43,48 ****
  #if PA_TRACE_REALTIME_EVENTS
  
! static char *traceTextArray[MAX_TRACE_RECORDS];
! static int traceIntArray[MAX_TRACE_RECORDS];
  static int traceIndex = 0;
  static int traceBlock = 0;
--- 43,48 ----
  #if PA_TRACE_REALTIME_EVENTS
  
! static char *traceTextArray[PA_MAX_TRACE_RECORDS];
! static int traceIntArray[PA_MAX_TRACE_RECORDS];
  static int traceIndex = 0;
  static int traceBlock = 0;
***************
*** 66,70 ****
                 i, traceTextArray[i], traceIntArray[i] );
      }
!     ResetTraceMessages();
      fflush(stdout);
  }
--- 66,70 ----
                 i, traceTextArray[i], traceIntArray[i] );
      }
!     PaUtil_ResetTraceMessages();
      fflush(stdout);
  }

Index: pa_process.c
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_process.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_process.c	30 May 2005 03:04:08 -0000	1.9
--- pa_process.c	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 132,135 ****
--- 132,143 ----
      unsigned long tempInputBufferSize, tempOutputBufferSize;
  
+     if( streamFlags & paNeverDropInput )
+     {
+         /* paNeverDropInput is only valid for full-duplex callback streams, with an unspecified number of frames per buffer. */
+         if( !streamCallback || !(inputChannelCount > 0 && outputChannelCount > 0) ||
+                 framesPerUserBuffer != paFramesPerBufferUnspecified )
+             return paInvalidFlag;
+     }
+ 
      /* initialize buffer ptrs to zero so they can be freed if necessary in error */
      bp->tempInputBuffer = 0;
***************
*** 572,576 ****
  {
      assert( channel < bp->outputChannelCount );
!     
      bp->hostOutputChannels[0][channel].data = data;
      bp->hostOutputChannels[0][channel].stride = stride;
--- 580,585 ----
  {
      assert( channel < bp->outputChannelCount );
!     assert( data != NULL );
! 
      bp->hostOutputChannels[0][channel].data = data;
      bp->hostOutputChannels[0][channel].stride = stride;
***************
*** 593,599 ****
      for( i=0; i< channelCount; ++i )
      {
!         bp->hostOutputChannels[0][channel+i].data = p;
          p += bp->bytesPerHostOutputSample;
-         bp->hostOutputChannels[0][channel+i].stride = channelCount;
      }
  }
--- 602,607 ----
      for( i=0; i< channelCount; ++i )
      {
!         PaUtil_SetOutputChannel( bp, channel + i, p, channelCount );
          p += bp->bytesPerHostOutputSample;
      }
  }
***************
*** 605,610 ****
      assert( channel < bp->outputChannelCount );
  
!     bp->hostOutputChannels[0][channel].data = data;
!     bp->hostOutputChannels[0][channel].stride = 1;
  }
  
--- 613,617 ----
      assert( channel < bp->outputChannelCount );
  
!     PaUtil_SetOutputChannel( bp, channel, data, 1 );
  }
  
***************
*** 621,624 ****
--- 628,632 ----
  {
      assert( channel < bp->outputChannelCount );
+     assert( data != NULL );
  
      bp->hostOutputChannels[1][channel].data = data;
***************
*** 642,648 ****
      for( i=0; i< channelCount; ++i )
      {
!         bp->hostOutputChannels[1][channel+i].data = p;
          p += bp->bytesPerHostOutputSample;
-         bp->hostOutputChannels[1][channel+i].stride = channelCount;
      }
  }
--- 650,655 ----
      for( i=0; i< channelCount; ++i )
      {
!         PaUtil_Set2ndOutputChannel( bp, channel + i, p, channelCount );
          p += bp->bytesPerHostOutputSample;
      }
  }
***************
*** 654,659 ****
      assert( channel < bp->outputChannelCount );
      
!     bp->hostOutputChannels[1][channel].data = data;
!     bp->hostOutputChannels[1][channel].stride = 1;
  }
  
--- 661,665 ----
      assert( channel < bp->outputChannelCount );
      
!     PaUtil_Set2ndOutputChannel( bp, channel, data, 1 );
  }
  
***************
*** 1181,1184 ****
--- 1187,1191 ----
           for( i=0; i<bp->outputChannelCount; ++i )
           {
+              assert( hostOutputChannels[i].data != NULL );
               bp->outputConverter(    hostOutputChannels[i].data,
                                       hostOutputChannels[i].stride,

Index: pa_front.c
===================================================================
RCS file: /cvsroot/pure-data/pd/portaudio/pa_common/pa_front.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pa_front.c	30 May 2005 03:04:08 -0000	1.9
--- pa_front.c	3 Jun 2006 19:13:06 -0000	1.10
***************
*** 257,260 ****
--- 257,263 ----
          if( hostApis_[hostApisCount_] )
          {
+             PaUtilHostApiRepresentation* hostApi = hostApis_[hostApisCount_];
+             assert( hostApi->info.defaultInputDevice < hostApi->info.deviceCount );
+             assert( hostApi->info.defaultOutputDevice < hostApi->info.deviceCount );
  
              hostApis_[hostApisCount_]->privatePaFrontInfo.baseDeviceIndex = baseDeviceIndex;
***************
*** 906,911 ****
      - at least one of inputParameters & outputParmeters is valid (not NULL)
  
!     - if inputParameters & outputParmeters are both valid, that
!         inputParameters->device & outputParmeters->device  both use the same host api
   
      PaDeviceIndex inputParameters->device
--- 909,914 ----
      - at least one of inputParameters & outputParmeters is valid (not NULL)
  
!     - if inputParameters & outputParameters are both valid, that
!         inputParameters->device & outputParameters->device  both use the same host api
   
      PaDeviceIndex inputParameters->device
***************
*** 1787,1795 ****
          if( frames == 0 )
          {
!             result = paInternalError; /** @todo should return a different error code */
          }
          else if( buffer == 0 )
          {
!             result = paInternalError; /** @todo should return a different error code */
          }
          else
--- 1790,1799 ----
          if( frames == 0 )
          {
!             /* XXX: Should we not allow the implementation to signal any overflow condition? */
!             result = paNoError;
          }
          else if( buffer == 0 )
          {
!             result = paBadBufferPtr;
          }
          else
***************
*** 1831,1839 ****
          if( frames == 0 )
          {
!             result = paInternalError; /** @todo should return a different error code */
          }
          else if( buffer == 0 )
          {
!             result = paInternalError; /** @todo should return a different error code */
          }
          else
--- 1835,1844 ----
          if( frames == 0 )
          {
!             /* XXX: Should we not allow the implementation to signal any underflow condition? */
!             result = paNoError;
          }
          else if( buffer == 0 )
          {
!             result = paBadBufferPtr;
          }
          else





More information about the Pd-cvs mailing list