diff options
author | Max Kellermann <max@duempel.org> | 2009-10-23 10:32:25 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-10-23 10:32:25 +0200 |
commit | c4f895daf4bcfcda2ea892896f999911f37cec26 (patch) | |
tree | 4d6117f7acdce32a1ea9a9c535c331c0699e88f5 /src/mixer_control.c | |
parent | ede828c910f546dfe8ca4b07b678e9a2806c6889 (diff) | |
download | mpd-c4f895daf4bcfcda2ea892896f999911f37cec26.tar.gz mpd-c4f895daf4bcfcda2ea892896f999911f37cec26.tar.xz mpd-c4f895daf4bcfcda2ea892896f999911f37cec26.zip |
mixer_plugin: get_volume() may return -1 if unavailable
If the method get_volume() returns -1 and no error object is set, then
the volume is currently unavailable, but the mixer should not be
closed immediately.
Diffstat (limited to '')
-rw-r--r-- | src/mixer_control.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mixer_control.c b/src/mixer_control.c index 7def51cb2..7a8ba48e4 100644 --- a/src/mixer_control.c +++ b/src/mixer_control.c @@ -140,9 +140,13 @@ mixer_get_volume(struct mixer *mixer, GError **error_r) g_mutex_lock(mixer->mutex); if (mixer->open) { - volume = mixer->plugin->get_volume(mixer, error_r); - if (volume < 0) + GError *error = NULL; + + volume = mixer->plugin->get_volume(mixer, &error); + if (volume < 0 && error != NULL) { + g_propagate_error(error_r, error); mixer_failed(mixer); + } } else volume = -1; |