diff options
author | Max Kellermann <max@duempel.org> | 2008-09-07 13:51:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-07 13:51:50 +0200 |
commit | 4ddc0a48e2e53acc58990ec72e907a136e51d77e (patch) | |
tree | a92187be3b042e2a89923d767e85d5bb99b09739 /src/audio.c | |
parent | f7e414d9347aaf2397f883181c8bdb6959380143 (diff) | |
download | mpd-4ddc0a48e2e53acc58990ec72e907a136e51d77e.tar.gz mpd-4ddc0a48e2e53acc58990ec72e907a136e51d77e.tar.xz mpd-4ddc0a48e2e53acc58990ec72e907a136e51d77e.zip |
audio: don't pass "fd" to {en,dis}ableAudioDevice()
No protocol code in the audio output library.
Diffstat (limited to '')
-rw-r--r-- | src/audio.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/audio.c b/src/audio.c index b539d6f7c..cea5a5a93 100644 --- a/src/audio.c +++ b/src/audio.c @@ -19,9 +19,7 @@ #include "audio.h" #include "audioOutput.h" #include "log.h" -#include "command.h" #include "path.h" -#include "ack.h" #include "myfprintf.h" #include "os_compat.h" @@ -428,13 +426,10 @@ void sendMetadataToAudioDevice(const struct tag *tag) } } -int enableAudioDevice(int fd, unsigned int device) +int enableAudioDevice(unsigned int device) { - if (device >= audioOutputArraySize) { - commandError(fd, ACK_ERROR_ARG, "audio output device id %i " - "doesn't exist\n", device); + if (device >= audioOutputArraySize) return -1; - } if (!(audioDeviceStates[device] & 0x01)) audioDeviceStates[device] = DEVICE_ENABLE; @@ -442,13 +437,11 @@ int enableAudioDevice(int fd, unsigned int device) return 0; } -int disableAudioDevice(int fd, unsigned int device) +int disableAudioDevice(unsigned int device) { - if (device >= audioOutputArraySize) { - commandError(fd, ACK_ERROR_ARG, "audio output device id %i " - "doesn't exist\n", device); + if (device >= audioOutputArraySize) return -1; - } + if (audioDeviceStates[device] & 0x01) audioDeviceStates[device] = DEVICE_DISABLE; |