now np's OSS stuff actually works
git-svn-id: https://svn.musicpd.org/mpd/trunk@2459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
b0d7d6b06f
commit
c269e18813
|
@ -44,6 +44,7 @@ static int audioOutputArraySize = 0;
|
||||||
|
|
||||||
extern AudioOutputPlugin aoPlugin;
|
extern AudioOutputPlugin aoPlugin;
|
||||||
extern AudioOutputPlugin shoutPlugin;
|
extern AudioOutputPlugin shoutPlugin;
|
||||||
|
extern AudioOutputPlugin ossPlugin;
|
||||||
|
|
||||||
void initAudioDriver() {
|
void initAudioDriver() {
|
||||||
ConfigParam * param = NULL;
|
ConfigParam * param = NULL;
|
||||||
|
@ -52,6 +53,7 @@ void initAudioDriver() {
|
||||||
initAudioOutputPlugins();
|
initAudioOutputPlugins();
|
||||||
loadAudioOutputPlugin(&aoPlugin);
|
loadAudioOutputPlugin(&aoPlugin);
|
||||||
loadAudioOutputPlugin(&shoutPlugin);
|
loadAudioOutputPlugin(&shoutPlugin);
|
||||||
|
loadAudioOutputPlugin(&ossPlugin);
|
||||||
|
|
||||||
while((param = getNextConfigParam(CONF_AUDIO_OUTPUT, param))) {
|
while((param = getNextConfigParam(CONF_AUDIO_OUTPUT, param))) {
|
||||||
i = audioOutputArraySize++;
|
i = audioOutputArraySize++;
|
||||||
|
|
|
@ -69,7 +69,7 @@ AudioOutput * newAudioOutput(ConfigParam * param) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ERROR("couldn't find audio output plugin for type \"%s\" at "
|
ERROR("couldn't find audio output plugin for type \"%s\" at "
|
||||||
"line %i", type, param->line);
|
"line %i\n", type, param->line);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,11 +75,13 @@ static int oss_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
||||||
if(!bp) {
|
if(!bp) {
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if(0 <= (fd = open("/dev/sound/dsp", O_WRONLY | O_NONBLOCK))) {
|
if(0 <= (fd = open("/dev/sound/dsp", O_WRONLY))) {
|
||||||
od->device = strdup("/dev/sound/dsp");
|
od->device = strdup("/dev/sound/dsp");
|
||||||
|
close(fd);
|
||||||
}
|
}
|
||||||
else if(0 <= (fd = open("/dev/dsp", O_WRONLY | O_NONBLOCK))) {
|
else if(0 <= (fd = open("/dev/dsp", O_WRONLY))) {
|
||||||
od->device = strdup("/dev/dsp");
|
od->device = strdup("/dev/dsp");
|
||||||
|
close(fd);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ERROR("Error trying to open default OSS device "
|
ERROR("Error trying to open default OSS device "
|
||||||
|
@ -89,7 +91,6 @@ static int oss_initDriver(AudioOutput * audioOutput, ConfigParam * param) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(od->fd);
|
|
||||||
od->fd = -1;
|
od->fd = -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue