summaryrefslogtreecommitdiff
path: root/audio/libmikmod/patches/patch-ad
blob: b7301959636507d011244791a0fc840b383be4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
$NetBSD: patch-ad,v 1.4 2001/03/31 03:03:09 mycroft Exp $

--- drivers/drv_sun.c.orig	Mon Feb 14 22:10:21 2000
+++ drivers/drv_sun.c	Sat Mar 31 03:01:36 2001
@@ -61,7 +61,7 @@
 #include <sys/audioio.h>
 #endif
 
-#define DEFAULT_FRAGSIZE 12
+#define DEFAULT_FRAGSIZE 13
 
 #if !defined __NetBSD__  && !defined __OpenBSD__
 #ifdef HAVE_SUN_AUDIOIO_H
@@ -72,26 +72,12 @@
 #endif
 
 /* Sound device to open */
-#ifdef SUNOS4
+#ifndef SOLARIS /* SunOS, NetBSD */
 #define SOUNDDEVICE "/dev/sound"
 #else /* Solaris, *BSD */
 #define SOUNDDEVICE "/dev/audio"
 #endif
 
-/* Compatibility defines, for old *BSD or SunOS systems */
-#ifndef AUDIO_ENCODING_PCM16
-#define AUDIO_ENCODING_PCM16 AUDIO_ENCODING_LINEAR
-#endif
-#ifndef AUDIO_ENCODING_PCM8
-#define AUDIO_ENCODING_PCM8 AUDIO_ENCODING_LINEAR8
-#endif
-#ifndef AUDIO_ENCODING_SLINEAR_LE
-#define AUDIO_ENCODING_SLINEAR_LE AUDIO_ENCODING_PCM16
-#endif
-#ifndef AUDIO_ENCODING_ULINEAR_LE
-#define AUDIO_ENCODING_ULINEAR_LE AUDIO_ENCODING_PCM8
-#endif
-
 /* Compatibility defines, for old *BSD systems */
 #ifndef AUDIO_SPEAKER
 #define AUDIO_SPEAKER 0x01
@@ -262,7 +248,7 @@
 			md_mode |= (DMODE_STEREO | DMODE_16BITS);
 			play_precision = 16;
 			play_stereo = 2;
-			play_encoding = AUDIO_ENCODING_SLINEAR_LE;
+			play_encoding = AUDIO_ENCODING_LINEAR;
 		}
 #endif
 	}
@@ -273,13 +259,7 @@
 		if ((play_precision == 8) && (play_stereo == 1) &&
 			(play_rate <= 8000)) play_encoding = AUDIO_ENCODING_ULAW;
 		else
-#ifdef SUNOS4
 			play_encoding = AUDIO_ENCODING_LINEAR;
-#else
-			play_encoding =
-				(play_precision ==
-				 16) ? AUDIO_ENCODING_SLINEAR_LE : AUDIO_ENCODING_ULINEAR_LE;
-#endif
 	}
 
 	/* get current audio settings if we want to keep the playback output
@@ -319,7 +299,9 @@
 	}
 	if ((audioinfo.play.precision != play_precision) ||
 		(audioinfo.play.channels != play_stereo) ||
+#if 0
 		(audioinfo.play.encoding != play_encoding) ||
+#endif
 		(audioinfo.play.sample_rate != play_rate)) {
 		_mm_errno = MMERR_SUN_INIT;
 		return 1;