mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
Detect support for Solaris (/dev/audio).
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@516 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
0eed96d764
commit
d1bc972e69
2 changed files with 35 additions and 1 deletions
|
|
@ -309,7 +309,10 @@ AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
|
||||||
|
|
||||||
#### Solaris audio support (optional) ####
|
#### Solaris audio support (optional) ####
|
||||||
|
|
||||||
AC_CHECK_HEADERS([sys/audio.h], [HAVE_SOLARIS=1], [HAVE_SOLARIS=0])
|
AC_CHECK_HEADERS([sys/audio.h], [
|
||||||
|
HAVE_SOLARIS=1
|
||||||
|
AC_DEFINE([HAVE_SOLARIS], 1, [Have Solaris audio?])
|
||||||
|
], [HAVE_SOLARIS=0])
|
||||||
AC_SUBST(HAVE_SOLARIS)
|
AC_SUBST(HAVE_SOLARIS)
|
||||||
AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
|
AM_CONDITIONAL([HAVE_SOLARIS], [test "x$HAVE_SOLARIS" = x1])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,34 @@ static int detect_oss(pa_core *c, int just_one) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SOLARIS
|
||||||
|
static int detect_solaris(pa_core *c, int just_one) {
|
||||||
|
struct stat s;
|
||||||
|
const char *dev;
|
||||||
|
char args[64];
|
||||||
|
|
||||||
|
dev = getenv("AUDIODEV");
|
||||||
|
if (!dev)
|
||||||
|
dev = "/dev/audio";
|
||||||
|
|
||||||
|
if (stat(dev, &s) < 0) {
|
||||||
|
if (errno != ENOENT)
|
||||||
|
pa_log_error(__FILE__": failed to open device %s: %s\n", dev, strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!S_ISCHR(s))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
snprintf(args, sizeof(args), "device=%s", dev);
|
||||||
|
|
||||||
|
if (!pa_module_load(c, "module-solaris", args))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int pa__init(pa_core *c, pa_module*m) {
|
int pa__init(pa_core *c, pa_module*m) {
|
||||||
int just_one = 0, n = 0;
|
int just_one = 0, n = 0;
|
||||||
pa_modargs *ma;
|
pa_modargs *ma;
|
||||||
|
|
@ -198,6 +226,9 @@ int pa__init(pa_core *c, pa_module*m) {
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_OSS
|
#if HAVE_OSS
|
||||||
if ((n = detect_oss(c, just_one)) <= 0)
|
if ((n = detect_oss(c, just_one)) <= 0)
|
||||||
|
#endif
|
||||||
|
#if HAVE_SOLARIS
|
||||||
|
if ((n = detect_solaris(c, just_one)) <= 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
pa_log_warn(__FILE__": failed to detect any sound hardware.\n");
|
pa_log_warn(__FILE__": failed to detect any sound hardware.\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue