OSS audio cleanup

- include sys/ioctl.h before soundcard.h
- use /dev/audio, not /dev/dsp
- use a proper value for SNDCTL_DSP_SETFRAGMENT
This commit is contained in:
jakemsr 2007-10-29 07:59:27 +00:00
parent 27c23115f6
commit 419556f518
3 changed files with 46 additions and 6 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.14 2007/09/15 21:26:00 simon Exp $
# $OpenBSD: Makefile,v 1.15 2007/10/29 07:59:27 jakemsr Exp $
# $NetBSD: Makefile,v 1.2 2000/01/07 04:20:49 hubertf Exp $
COMMENT= ac3 audio (as used on DVDs) decoding tools
DISTNAME= ac3dec-0.6.1
PKGNAME= ${DISTNAME}p0
PKGNAME= ${DISTNAME}p1
CATEGORIES= audio
HOMEPAGE= http://liba52.sourceforge.net/

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-libac3_Makefile_in,v 1.1 2001/02/27 12:12:46 naddy Exp $
--- libac3/Makefile.in.orig Mon Feb 26 01:59:16 2001
+++ libac3/Makefile.in Mon Feb 26 01:59:35 2001
$OpenBSD: patch-libac3_Makefile_in,v 1.2 2007/10/29 07:59:27 jakemsr Exp $
--- libac3/Makefile.in.orig Wed Mar 29 16:55:28 2000
+++ libac3/Makefile.in Mon Oct 29 00:13:50 2007
@@ -70,8 +70,6 @@ VERSION = @VERSION@
AUTOMAKE_OPTIONS = 1.3 foreign
@ -10,7 +10,7 @@ $OpenBSD: patch-libac3_Makefile_in,v 1.1 2001/02/27 12:12:46 naddy Exp $
noinst_LIBRARIES = libac3.a
libac3_a_SOURCES = bitstream.c decode.c imdct.c coeff.c exponent.c stats.c bit_allocate.c parse.c crc.c debug.c rematrix.c downmix.c dither.c sanity_check.c
@@ -94,6 +92,7 @@ libac3_a_OBJECTS = bitstream.o decode.o
@@ -94,6 +92,7 @@ libac3_a_OBJECTS = bitstream.o decode.o imdct.o coeff
stats.o bit_allocate.o parse.o crc.o debug.o rematrix.o downmix.o \
dither.o sanity_check.o
AR = ar

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-output_linux_c,v 1.1 2007/10/29 07:59:27 jakemsr Exp $
--- output_linux.c.orig Mon Oct 29 00:17:49 2007
+++ output_linux.c Mon Oct 29 00:23:37 2007
@@ -33,6 +33,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
+#include <sys/ioctl.h>
#if defined(__OpenBSD__)
#include <soundcard.h>
#elif defined(__FreeBSD__)
@@ -40,16 +41,15 @@
#else
#include <sys/soundcard.h>
#endif
-#include <sys/ioctl.h>
//this sux...types should go in config.h methinks
-typedef signed short sint_16;
-typedef unsigned int uint_32;
+typedef int16_t sint_16;
+typedef uint32_t uint_32;
#include "output.h"
-static char dev[] = "/dev/dsp";
+static char dev[] = "/dev/audio";
static int fd;
@@ -82,7 +82,7 @@ int output_open(int bits, int rate, int channels)
ioctl(fd,SNDCTL_DSP_SPEED, &tmp);
//this is cheating
- tmp = 256;
+ tmp = 0x000c000a;
ioctl(fd,SNDCTL_DSP_SETFRAGMENT,&tmp);