CVS: rdesktop rdpsnd_libao.c,1.13,1.14

Michael Gernoth <[email protected]> Sun, 09 Jul 2006 16:41:09 -0700
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20013

Modified Files:
	rdpsnd_libao.c 
Log Message:
declare local variables static and remove g_prefix.
this removes a clash with another global variable...


Index: rdpsnd_libao.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_libao.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** rdpsnd_libao.c	8 Feb 2006 13:35:35 -0000	1.13
--- rdpsnd_libao.c	9 Jul 2006 23:41:07 -0000	1.14
***************
*** 32,42 ****
  
  int g_dsp_fd;
- ao_device *o_device = NULL;
- int default_driver;
- int g_samplerate;
- int g_channels;
  BOOL g_dsp_busy = False;
! static BOOL g_reopened;
! static short g_samplewidth;
  
  static struct audio_packet
--- 32,42 ----
  
  int g_dsp_fd;
  BOOL g_dsp_busy = False;
! static ao_device *o_device = NULL;
! static int default_driver;
! static int samplerate;
! static int audiochannels;
! static BOOL reopened;
! static short samplewidth;
  
  static struct audio_packet
***************
*** 58,64 ****
  	format.bits = 16;
  	format.channels = 2;
! 	g_channels = 2;
  	format.rate = 44100;
! 	g_samplerate = 44100;
  	format.byte_format = AO_FMT_LITTLE;
  
--- 58,64 ----
  	format.bits = 16;
  	format.channels = 2;
! 	audiochannels = 2;
  	format.rate = 44100;
! 	samplerate = 44100;
  	format.byte_format = AO_FMT_LITTLE;
  
***************
*** 72,76 ****
  	queue_lo = queue_hi = 0;
  
! 	g_reopened = True;
  
  	return True;
--- 72,76 ----
  	queue_lo = queue_hi = 0;
  
! 	reopened = True;
  
  	return True;
***************
*** 118,127 ****
  	format.bits = pwfx->wBitsPerSample;
  	format.channels = pwfx->nChannels;
! 	g_channels = pwfx->nChannels;
  	format.rate = 44100;
! 	g_samplerate = pwfx->nSamplesPerSec;
  	format.byte_format = AO_FMT_LITTLE;
  
! 	g_samplewidth = pwfx->wBitsPerSample / 8;
  
  	if (o_device != NULL)
--- 118,127 ----
  	format.bits = pwfx->wBitsPerSample;
  	format.channels = pwfx->nChannels;
! 	audiochannels = pwfx->nChannels;
  	format.rate = 44100;
! 	samplerate = pwfx->nSamplesPerSec;
  	format.byte_format = AO_FMT_LITTLE;
  
! 	samplewidth = pwfx->wBitsPerSample / 8;
  
  	if (o_device != NULL)
***************
*** 134,138 ****
  	}
  
! 	g_reopened = True;
  
  	return True;
--- 134,138 ----
  	}
  
! 	reopened = True;
  
  	return True;
***************
*** 183,189 ****
  	int next_tick;
  
! 	if (g_reopened)
  	{
! 		g_reopened = False;
  		gettimeofday(&tv, NULL);
  		prev_s = tv.tv_sec;
--- 183,189 ----
  	int next_tick;
  
! 	if (reopened)
  	{
! 		reopened = False;
  		gettimeofday(&tv, NULL);
  		prev_s = tv.tv_sec;
***************
*** 211,218 ****
  	len = 0;
  
! 	if (g_samplerate == 22050)
  	{
  		/* Resample to 44100 */
! 		for (i = 0; (i < ((WAVEOUTBUF / 4) * (3 - g_samplewidth))) && (out->p < out->end);
  		     i++)
  		{
--- 211,218 ----
  	len = 0;
  
! 	if (samplerate == 22050)
  	{
  		/* Resample to 44100 */
! 		for (i = 0; (i < ((WAVEOUTBUF / 4) * (3 - samplewidth))) && (out->p < out->end);
  		     i++)
  		{
***************
*** 222,235 ****
  			   If we have a mono-channel, we can expand the data by simply
  			   doubling the sample-data: 1234 -> 11223344 */
! 			if (g_channels == 2)
! 				offset = ((i * 2) - (i & 1)) * g_samplewidth;
  			else
! 				offset = (i * 2) * g_samplewidth;
  
! 			memcpy(&outbuf[offset], out->p, g_samplewidth);
! 			memcpy(&outbuf[g_channels * g_samplewidth + offset], out->p, g_samplewidth);
  
! 			out->p += g_samplewidth;
! 			len += 2 * g_samplewidth;
  		}
  	}
--- 222,235 ----
  			   If we have a mono-channel, we can expand the data by simply
  			   doubling the sample-data: 1234 -> 11223344 */
! 			if (audiochannels == 2)
! 				offset = ((i * 2) - (i & 1)) * samplewidth;
  			else
! 				offset = (i * 2) * samplewidth;
  
! 			memcpy(&outbuf[offset], out->p, samplewidth);
! 			memcpy(&outbuf[audiochannels * samplewidth + offset], out->p, samplewidth);
  
! 			out->p += samplewidth;
! 			len += 2 * samplewidth;
  		}
  	}



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642