aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-26 22:21:32 +0100
committerMax Kellermann <max@duempel.org>2009-02-26 22:21:32 +0100
commit9e61c0503eaf385bc4cc6fb3f1702a163bb29cea (patch)
tree126e20604c788760109cdb65f2804e28069aec47
parent58c201ce1447eb2f0b3e04d21c74353412e0bcf1 (diff)
downloadmpd-9e61c0503eaf385bc4cc6fb3f1702a163bb29cea.tar.gz
mpd-9e61c0503eaf385bc4cc6fb3f1702a163bb29cea.tar.xz
mpd-9e61c0503eaf385bc4cc6fb3f1702a163bb29cea.zip
output_all: print a warning when all outputs are disabled
When all outputs are disabled, MPD printed only a meaningless message "problems opening audio device", although it didn't attempt to open a device.
Diffstat (limited to '')
-rw-r--r--src/output_all.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/output_all.c b/src/output_all.c
index cf921f801..c90a875dd 100644
--- a/src/output_all.c
+++ b/src/output_all.c
@@ -224,7 +224,7 @@ audio_output_all_play(const char *buffer, size_t length)
bool
audio_output_all_open(const struct audio_format *audio_format)
{
- bool ret = false;
+ bool ret = false, enabled = false;
unsigned int i;
if (audio_format != NULL)
@@ -234,10 +234,16 @@ audio_output_all_open(const struct audio_format *audio_format)
audio_output_all_update();
for (i = 0; i < num_audio_outputs; ++i) {
+ if (audio_outputs[i].enabled)
+ enabled = true;
+
if (audio_outputs[i].open)
ret = true;
}
+ if (!enabled)
+ g_warning("All audio outputs are disabled");
+
if (!ret)
/* close all devices if there was an error */
audio_output_all_close();