CVS: rdesktop rdpsnd_dsp.c,1.16,1.17

Michael Gernoth <[email protected]> Sun, 01 Oct 2006 12:05:32 -0700
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1518

Modified Files:
	rdpsnd_dsp.c 
Log Message:
simplify resampling


Index: rdpsnd_dsp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_dsp.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** rdpsnd_dsp.c	1 Oct 2006 18:22:05 -0000	1.16
--- rdpsnd_dsp.c	1 Oct 2006 19:05:30 -0000	1.17
***************
*** 279,297 ****
  	{
  		int source = ((i * 1000) + ratio1k - 1000) / (ratio1k + 1);
  
  		if (source * resample_to_channels + samplewidth > size)
  			break;
  
! 		if (resample_to_channels == 2)
! 		{
! 			memcpy(*out + (i * resample_to_channels * samplewidth),
! 			       in + (source * resample_to_channels * samplewidth), samplewidth);
! 			memcpy(*out + (i * resample_to_channels * samplewidth) + samplewidth,
! 			       in + (source * resample_to_channels * samplewidth) + samplewidth,
! 			       samplewidth);
! 		}
! 		else
  		{
! 			memcpy(*out + (i * samplewidth), in + (source * samplewidth), samplewidth);
  		}
  	}
--- 279,292 ----
  	{
  		int source = ((i * 1000) + ratio1k - 1000) / (ratio1k + 1);
+ 		int j;
  
  		if (source * resample_to_channels + samplewidth > size)
  			break;
  
! 		for (j = 0; j < resample_to_channels; j++)
  		{
! 			memcpy(*out + (i * resample_to_channels * samplewidth) + (samplewidth * j),
! 					in + (source * resample_to_channels * samplewidth) + (samplewidth * j),
! 					samplewidth);
  		}
  	}


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV