shithub: libsamplerate

Download patch

ref: d61c04715476bf4dc31e0890dd57faff2cbdbc55
parent: 708f7b639e7c4fe97b061466cd508d2025e09d6f
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Mon Jan 21 01:34:10 EST 2008

examples/audio_out.c : Apply patch to fix compile problems with OSS v4.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-21  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    * examples/audio_out.c
+    Apply patch from Yair K. to fix compiles with OSS v4.
+
 2007-07-07  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * acinclude.m4
--- a/examples/audio_out.c
+++ b/examples/audio_out.c
@@ -91,17 +91,17 @@
 		} ;
 
 	fmt = CPU_IS_BIG_ENDIAN ? AFMT_S16_BE : AFMT_S16_LE ;
-	if (ioctl (linux_out->fd, SOUND_PCM_SETFMT, &fmt) != 0)
+	if (ioctl (linux_out->fd, SNDCTL_DSP_SETFMT, &fmt) != 0)
 	{	perror ("linux_open_dsp_device : set format ") ;
 	    exit (1) ;
   		} ;
 
-	if ((error = ioctl (linux_out->fd, SOUND_PCM_WRITE_CHANNELS, &channels)) != 0)
+	if ((error = ioctl (linux_out->fd, SNDCTL_DSP_CHANNELS, &channels)) != 0)
 	{	perror ("linux_open : channels ") ;
 		exit (1) ;
 		} ;
 
-	if ((error = ioctl (linux_out->fd, SOUND_PCM_WRITE_RATE, &samplerate)) != 0)
+	if ((error = ioctl (linux_out->fd, SNDCTL_DSP_SPEED, &samplerate)) != 0)
 	{	perror ("linux_open : sample rate ") ;
 		exit (1) ;
 		} ;