patch-src_modules_module-detect_c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $OpenBSD: patch-src_modules_module-detect_c,v 1.10 2016/06/28 08:47:18 ajacoutot Exp $
  2. --- src/modules/module-detect.c.orig Tue May 10 14:28:04 2016
  3. +++ src/modules/module-detect.c Tue Jun 28 09:57:18 2016
  4. @@ -32,6 +32,10 @@
  5. #include <sys/types.h>
  6. #include <sys/stat.h>
  7. +#ifdef __OpenBSD__
  8. +#include <sndio.h>
  9. +#endif
  10. +
  11. #include <pulsecore/core-error.h>
  12. #include <pulsecore/module.h>
  13. #include <pulsecore/modargs.h>
  14. @@ -206,6 +210,19 @@ static int detect_solaris(pa_core *c, int just_one) {
  15. }
  16. #endif
  17. +#ifdef __OpenBSD__
  18. +static int detect_sndio(pa_core *c, int just_one) {
  19. + char args[64];
  20. +
  21. + pa_snprintf(args, sizeof(args), "device=%s", SIO_DEVANY);
  22. +
  23. + if (!pa_module_load(c, "module-sndio", args))
  24. + return 0;
  25. +
  26. + return 1;
  27. +}
  28. +#endif
  29. +
  30. #ifdef OS_IS_WIN32
  31. static int detect_waveout(pa_core *c, int just_one) {
  32. /*
  33. @@ -247,6 +264,9 @@ int pa__init(pa_module*m) {
  34. #endif
  35. #ifdef OS_IS_WIN32
  36. if ((n = detect_waveout(m->core, just_one)) <= 0)
  37. +#endif
  38. +#ifdef __OpenBSD__
  39. + if ((n = detect_sndio(m->core, just_one)) <= 0)
  40. #endif
  41. {
  42. pa_log_warn("failed to detect any sound hardware.");