CVS: rdesktop rdpsnd_oss.c,1.24,1.25

Michael Gernoth <[email protected]> Mon, 18 Sep 2006 03:17:27 -0700
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19650

Modified Files:
	rdpsnd_oss.c 
Log Message:
fall back to software volume control when the mixer ioctl fails on the
dsp fd


Index: rdpsnd_oss.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_oss.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** rdpsnd_oss.c	17 Sep 2006 15:25:10 -0000	1.24
--- rdpsnd_oss.c	18 Sep 2006 10:17:24 -0000	1.25
***************
*** 30,33 ****
--- 30,34 ----
  #include "rdesktop.h"
  #include "rdpsnd.h"
+ #include "rdpsnd_dsp.h"
  #include <unistd.h>
  #include <fcntl.h>
***************
*** 43,46 ****
--- 44,48 ----
  static short samplewidth;
  static char *dsp_dev;
+ static struct audio_driver oss_driver;
  
  BOOL
***************
*** 154,185 ****
  oss_volume(uint16 left, uint16 right)
  {
- 	static BOOL use_dev_mixer = False;
  	uint32 volume;
- 	int fd_mix = -1;
  
  	volume = left / (65536 / 100);
  	volume |= right / (65536 / 100) << 8;
  
- 	if (use_dev_mixer)
- 	{
- 		if ((fd_mix = open("/dev/mixer", O_RDWR | O_NONBLOCK)) == -1)
- 		{
- 			perror("open /dev/mixer");
- 			return;
- 		}
- 
- 		if (ioctl(fd_mix, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
- 		{
- 			perror("MIXER_WRITE(SOUND_MIXER_PCM)");
- 			return;
- 		}
- 
- 		close(fd_mix);
- 	}
- 
  	if (ioctl(g_dsp_fd, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
  	{
  		perror("MIXER_WRITE(SOUND_MIXER_PCM)");
! 		use_dev_mixer = True;
  		return;
  	}
--- 156,168 ----
  oss_volume(uint16 left, uint16 right)
  {
  	uint32 volume;
  
  	volume = left / (65536 / 100);
  	volume |= right / (65536 / 100) << 8;
  
  	if (ioctl(g_dsp_fd, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
  	{
  		perror("MIXER_WRITE(SOUND_MIXER_PCM)");
! 		oss_driver.wave_out_volume = rdpsnd_dsp_softvol_set;
  		return;
  	}
***************
*** 256,261 ****
  oss_register(char *options)
  {
- 	static struct audio_driver oss_driver;
- 
  	oss_driver.wave_out_write = rdpsnd_queue_write;
  	oss_driver.wave_out_open = oss_open;
--- 239,242 ----


-------------------------------------------------------------------------
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