[PATCH] let ccaudio2 compile with OSS v4

"Yair K." <[email protected]> Thu, 10 Jan 2008 14:23:21 +0200
Newsgroups gmane.comp.gnu.ccaudio.devel
Message-ID <[email protected]>
--Boundary-00=_54ghHSf+cqu9SJy
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I noticed that when using the soundcard.h from the Open Sound System v4  
package[1], ccaudio2 won't compile. The attached patch fixes that by using 
more modern ioctls.

[1] http://developer.opensound.com

Yours,
	Yair K.

--Boundary-00=_54ghHSf+cqu9SJy
Content-Type: text/x-diff;
  charset="utf-8";
  name="ccaudio.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="ccaudio.diff"

--- src/oss.cpp.bak	2008-01-10 00:55:22.254039790 +0200
+++ src/oss.cpp	2008-01-10 01:42:26.242222687 +0200
@@ -175,20 +175,19 @@
 
 	enabled = false;
 
-	ioctl(dsp, SOUND_PCM_RESET, NULL);
-	ioctl(dsp, SOUND_PCM_SYNC, NULL);
-	ioctl(dsp, SOUND_PCM_SUBDIVIDE, &div);
-	if(ioctl(dsp, SOUND_PCM_SETFMT, &codec))
+	ioctl(dsp, SNDCTL_DSP_RESET, NULL);
+	ioctl(dsp, SNDCTL_DSP_SYNC, NULL);
+	ioctl(dsp, SNDCTL_DSP_SUBDIVIDE, &div);
+
+	if(ioctl(dsp, SNDCTL_DSP_SETFMT, &codec))
 		return false;
 
-	if(ioctl(dsp, SOUND_PCM_WRITE_RATE, &srate))
+	if(ioctl(dsp, SNDCTL_DSP_SPEED, &srate))
 		return false;
 
-	if(ioctl(dsp, SOUND_PCM_WRITE_CHANNELS, &channels))
+	if(ioctl(dsp, SNDCTL_DSP_CHANNELS, &channels))
 		return false;
 
-	ioctl(dsp, SOUND_PCM_READ_RATE, &srate);
-	ioctl(dsp, SOUND_PCM_READ_CHANNELS, &channels);
 	ioctl(dsp, SNDCTL_DSP_GETBLKSIZE, &blksize);
 	info.framesize = blksize;	
 	info.framecount = toSamples(info.encoding, blksize);

--Boundary-00=_54ghHSf+cqu9SJy
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Ccaudio-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccaudio-devel

--Boundary-00=_54ghHSf+cqu9SJy--