[PD-cvs] pd/src s_audio_pa.c,1.4.4.6,1.4.4.7

Tim Blechmann timblech at users.sourceforge.net
Mon May 16 14:57:21 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12674

Modified Files:
      Tag: devel_0_38
	s_audio_pa.c 
Log Message:
fix for missing devices

Index: s_audio_pa.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio_pa.c,v
retrieving revision 1.4.4.6
retrieving revision 1.4.4.7
diff -C2 -d -r1.4.4.6 -r1.4.4.7
*** s_audio_pa.c	15 May 2005 19:03:37 -0000	1.4.4.6
--- s_audio_pa.c	16 May 2005 12:57:08 -0000	1.4.4.7
***************
*** 56,60 ****
  {
      PaError err;
!     int j, devno, pa_indev = 0, pa_outdev = 0;
  
  	if (schedmode == 1)
--- 56,60 ----
  {
      PaError err;
!     int j, devno, pa_indev = -1, pa_outdev = -1;
  
  	if (schedmode == 1)
***************
*** 94,101 ****
          {
              const PaDeviceInfo *info = Pa_GetDeviceInfo(j);
!             if (info->maxInputChannels > 0)
              {
                  if (devno == indeviceno)
                  {
                      pa_indev = j;
                      break;
--- 94,104 ----
          {
              const PaDeviceInfo *info = Pa_GetDeviceInfo(j);
! 			int maxchans = info->maxInputChannels;
!             if (maxchans > 0)
              {
                  if (devno == indeviceno)
                  {
+ 					if (maxchans < inchans)
+ 						inchans = maxchans;
                      pa_indev = j;
                      break;
***************
*** 111,118 ****
          {
              const PaDeviceInfo *info = Pa_GetDeviceInfo(j);
!             if (info->maxOutputChannels > 0)
              {
                  if (devno == outdeviceno)
                  {
                      pa_outdev = j;
                      break;
--- 114,124 ----
          {
              const PaDeviceInfo *info = Pa_GetDeviceInfo(j);
! 			int maxchans = info->maxOutputChannels;
!             if (maxchans > 0)
              {
                  if (devno == outdeviceno)
                  {
+ 					if (maxchans < outchans)
+ 						outchans = maxchans;
                      pa_outdev = j;
                      break;
***************
*** 152,157 ****
  
  			/* report to portaudio */
! 			err = Pa_OpenStream(&pa_stream, (pa_indev ? &inputParameters : 0),
! 								(pa_outdev ? &outputParameters : 0), 
  								rate, 
  								sys_dacblocksize,
--- 158,164 ----
  
  			/* report to portaudio */
! 			err = Pa_OpenStream(&pa_stream,
! 								( (pa_indev != -1) ? &inputParameters : 0),
! 								( (pa_outdev != -1) ? &outputParameters : 0), 
  								rate, 
  								sys_dacblocksize,
***************
*** 319,323 ****
  	}
  
! 	if ((timenow = sys_getrealtime()) - timebefore > sys_sleepgrain * 1e-6)
  	{
  		return SENDDACS_SLEPT;
--- 326,330 ----
  	}
  
!     if (sys_getrealtime() > timebefore + sys_sleepgrain * 1e-6)
  	{
  		return SENDDACS_SLEPT;





More information about the Pd-cvs mailing list