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.
This commit is contained in:
parent
58c201ce14
commit
9e61c0503e
@ -224,7 +224,7 @@ audio_output_all_play(const char *buffer, size_t length)
|
|||||||
bool
|
bool
|
||||||
audio_output_all_open(const struct audio_format *audio_format)
|
audio_output_all_open(const struct audio_format *audio_format)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false, enabled = false;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (audio_format != NULL)
|
if (audio_format != NULL)
|
||||||
@ -234,10 +234,16 @@ audio_output_all_open(const struct audio_format *audio_format)
|
|||||||
audio_output_all_update();
|
audio_output_all_update();
|
||||||
|
|
||||||
for (i = 0; i < num_audio_outputs; ++i) {
|
for (i = 0; i < num_audio_outputs; ++i) {
|
||||||
|
if (audio_outputs[i].enabled)
|
||||||
|
enabled = true;
|
||||||
|
|
||||||
if (audio_outputs[i].open)
|
if (audio_outputs[i].open)
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!enabled)
|
||||||
|
g_warning("All audio outputs are disabled");
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
/* close all devices if there was an error */
|
/* close all devices if there was an error */
|
||||||
audio_output_all_close();
|
audio_output_all_close();
|
||||||
|
Loading…
Reference in New Issue
Block a user