openbsd-ports/audio/hydrogen/patches/patch-src_lib_drivers_OssDriver_cpp
jakemsr 756b4a6473 - default to /dev/audio for the audio device, but allow other
devices to be used as well

- add jack output.  these patches are back ported from hydrogen
subversion.

discussed with MAINTAINER
2008-03-24 03:09:42 +00:00

43 lines
1.2 KiB
Plaintext

$OpenBSD: patch-src_lib_drivers_OssDriver_cpp,v 1.3 2008/03/24 03:09:42 jakemsr Exp $
--- src/lib/drivers/OssDriver.cpp.orig Mon Oct 17 15:32:04 2005
+++ src/lib/drivers/OssDriver.cpp Sat Mar 1 00:48:07 2008
@@ -41,6 +41,7 @@ unsigned nNextFrames = 0;
void* ossDriver_processCaller(void* param)
{
+#ifndef __OpenBSD__
// stolen from amSynth
struct sched_param sched;
sched.sched_priority = 50;
@@ -50,6 +51,7 @@ void* ossDriver_processCaller(void* param)
m_pOssDriverInstance->warningLog("Can't set realtime scheduling for OSS Driver");
}
m_pOssDriverInstance->infoLog( "Scheduling priority = " + toString( sched.sched_priority ) );
+#endif
OssDriver *ossDriver = (OssDriver*)param;
@@ -126,7 +128,7 @@ int OssDriver::connect() {
int bs;
string audioDevice;
-#ifdef __NetBSD__
+#if defined(__NetBSD__)
audioDevice = "/dev/audio";
#else
audioDevice = preferencesMng->m_sOSSDevice;
@@ -178,11 +180,13 @@ int OssDriver::connect() {
infoLog( "Blocksize audio = " + toString( bs ) );
+#ifndef __OpenBSD__
if (bs != ( 1 << bufferBits) ){
errorLog("ERROR_IOCTL: unable to set BlockSize");
close(fd);
return 1;
}
+#endif
int format = AFMT_S16_LE;
if (ioctl(fd, SNDCTL_DSP_SETFMT, &format) == -1) {