54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
$OpenBSD: patch-src_modules_module-detect_c,v 1.4 2011/10/07 08:03:44 ajacoutot Exp $
|
|
--- src/modules/module-detect.c.orig Thu Sep 1 10:28:14 2011
|
|
+++ src/modules/module-detect.c Fri Oct 7 09:47:06 2011
|
|
@@ -48,7 +48,6 @@ PA_MODULE_DESCRIPTION("Detect available audio hardware
|
|
PA_MODULE_VERSION(PACKAGE_VERSION);
|
|
PA_MODULE_LOAD_ONCE(TRUE);
|
|
PA_MODULE_USAGE("just-one=<boolean>");
|
|
-PA_MODULE_DEPRECATED("Please use module-udev-detect instead of module-detect!");
|
|
|
|
static const char* const valid_modargs[] = {
|
|
"just-one",
|
|
@@ -118,6 +117,7 @@ static int detect_alsa(pa_core *c, int just_one) {
|
|
#endif
|
|
|
|
#ifdef HAVE_OSS_OUTPUT
|
|
+#if !defined(__OpenBSD__)
|
|
static int detect_oss(pa_core *c, int just_one) {
|
|
FILE *f;
|
|
int n = 0, b = 0;
|
|
@@ -175,6 +175,33 @@ static int detect_oss(pa_core *c, int just_one) {
|
|
fclose(f);
|
|
return n;
|
|
}
|
|
+#else
|
|
+static int detect_oss(pa_core *c, int just_one) {
|
|
+ struct stat s;
|
|
+ const char *dev;
|
|
+ char args[64];
|
|
+
|
|
+ dev = getenv("AUDIODEVICE");
|
|
+ if (!dev)
|
|
+ dev = "/dev/audio";
|
|
+
|
|
+ if (stat(dev, &s) < 0) {
|
|
+ if (errno != ENOENT)
|
|
+ pa_log_error("failed to open device %s: %s", dev, pa_cstrerror(errno));
|
|
+ return -1;
|
|
+ }
|
|
+
|
|
+ if (!S_ISCHR(s.st_mode))
|
|
+ return 0;
|
|
+
|
|
+ pa_snprintf(args, sizeof(args), "device=%s", dev);
|
|
+
|
|
+ if (!pa_module_load(c, "module-oss", args))
|
|
+ return 0;
|
|
+
|
|
+ return 1;
|
|
+}
|
|
+#endif
|
|
#endif
|
|
|
|
#ifdef HAVE_SOLARIS
|