openbsd-ports/audio/waveplay/patches/patch-waveplay_c
pvalchev e63048803c update to newer, BSD-licensed version
thanks to Michael Coulter <mjc@bitz.ca> for testing
2003-06-13 00:49:38 +00:00

38 lines
807 B
Plaintext

$OpenBSD: patch-waveplay_c,v 1.2 2003/06/13 00:49:38 pvalchev Exp $
--- waveplay.c.orig Mon Sep 24 01:38:40 2001
+++ waveplay.c Thu Jun 12 17:38:52 2003
@@ -36,6 +36,8 @@
#if defined (__FreeBSD__) && __FreeBSD__ < 4
#include <machine/soundcard.h>
+#elif defined (__OpenBSD__)
+#include <soundcard.h>
#else
#include <sys/soundcard.h>
#endif
@@ -43,8 +45,12 @@
#include "wavefmt.h"
#ifndef DEFAULT_DSP
+#ifdef __OpenBSD__
+#define DEFAULT_DSP "/dev/audio"
+#else
#define DEFAULT_DSP "/dev/dsp"
#endif
+#endif
#ifndef DEFAULT_BUFFERSIZE
#define DEFAULT_BUFFERSIZE 2048
@@ -350,7 +356,11 @@ int openDSP(const char* devname, PWAVEFO
int closeDSP(int fd)
{
+#ifdef __OpenBSD__
+ ioctl(fd, SNDCTL_DSP_SYNC, NULL);
+#else
ioctl(fd, SNDCTL_DSP_SYNC);
+#endif
return close(fd);
}