From 4d8438e63d7c1cbed3ec40bf073574f3c01fce56 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 7 Sep 2008 14:04:16 +0200 Subject: audio: don't pass "fd" to printAudioDevices() Pass the client struct instead. --- src/audio.c | 16 +++++++++------- src/audio.h | 3 ++- src/command.c | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/audio.c b/src/audio.c index cea5a5a93..5715ec8b5 100644 --- a/src/audio.c +++ b/src/audio.c @@ -20,7 +20,7 @@ #include "audioOutput.h" #include "log.h" #include "path.h" -#include "myfprintf.h" +#include "client.h" #include "os_compat.h" #define AUDIO_DEVICE_STATE "audio_device_state:" @@ -448,16 +448,18 @@ int disableAudioDevice(unsigned int device) return 0; } -void printAudioDevices(int fd) +void printAudioDevices(struct client *client) { unsigned int i; for (i = 0; i < audioOutputArraySize; i++) { - fdprintf(fd, - "outputid: %i\noutputname: %s\noutputenabled: %i\n", - i, - audioOutputArray[i].name, - audioDeviceStates[i] & 0x01); + client_printf(client, + "outputid: %i\n" + "outputname: %s\n" + "outputenabled: %i\n", + i, + audioOutputArray[i].name, + audioDeviceStates[i] & 0x01); } } diff --git a/src/audio.h b/src/audio.h index a261f6a1a..2d62407a9 100644 --- a/src/audio.h +++ b/src/audio.h @@ -25,6 +25,7 @@ #define AUDIO_AO_DRIVER_DEFAULT "default" struct tag; +struct client; void copyAudioFormat(AudioFormat * dest, const AudioFormat * src); @@ -64,7 +65,7 @@ int enableAudioDevice(unsigned int device); int disableAudioDevice(unsigned int device); -void printAudioDevices(int fd); +void printAudioDevices(struct client *client); void readAudioDevicesState(FILE *fp); diff --git a/src/command.c b/src/command.c index 05c6ed22e..ef151a872 100644 --- a/src/command.c +++ b/src/command.c @@ -1230,7 +1230,7 @@ static int handleDisableDevice(struct client *client, mpd_unused int *permission static int handleDevices(struct client *client, mpd_unused int *permission, mpd_unused int argc, mpd_unused char *argv[]) { - printAudioDevices(client_get_fd(client)); + printAudioDevices(client); return 0; } -- cgit v1.2.3