mirror of
https://github.com/owntone/owntone-server.git
synced 2025-12-05 07:12:35 -05:00
[player/outputs] Fix for speaker selection and volume adj (closes #1011)
* Make sure that vol_adjust() bases adjustments on the same speakers that the user sees as active * If a speaker fails during activation we unselect it, so that we don't keep trying to start it, so we find a new master volume if required, and so it is possible for the user to reselect it.
This commit is contained in:
10
src/player.c
10
src/player.c
@@ -1582,6 +1582,8 @@ device_activate_cb(struct output_device *device, enum output_device_state status
|
||||
{
|
||||
DPRINTF(E_LOG, L_PLAYER, "The %s device '%s' requires a valid PIN or password\n", device->type_name, device->name);
|
||||
|
||||
outputs_device_deselect(device);
|
||||
|
||||
retval = -2;
|
||||
goto out;
|
||||
}
|
||||
@@ -1590,6 +1592,8 @@ device_activate_cb(struct output_device *device, enum output_device_state status
|
||||
{
|
||||
DPRINTF(E_LOG, L_PLAYER, "The %s device '%s' failed to activate\n", device->type_name, device->name);
|
||||
|
||||
outputs_device_deselect(device);
|
||||
|
||||
if (retval != -2)
|
||||
retval = -1;
|
||||
goto out;
|
||||
@@ -2453,11 +2457,7 @@ device_to_speaker_info(struct player_speaker_info *spk, struct output_device *de
|
||||
spk->relvol = device->relvol;
|
||||
spk->absvol = device->volume;
|
||||
|
||||
// We can't map device->selected directly to spk->selected, since the former
|
||||
// means "has the user selected the device" (even if it isn't working or is
|
||||
// unavailable), while clients that get the latter just want to know if the
|
||||
// speaker plays or will be playing.
|
||||
spk->selected = (device->selected && device->state >= OUTPUT_STATE_STOPPED && !device->busy && !device->prevent_playback);
|
||||
spk->selected = OUTPUTS_DEVICE_DISPLAY_SELECTED(device);
|
||||
|
||||
spk->has_password = device->has_password;
|
||||
spk->has_video = device->has_video;
|
||||
|
||||
Reference in New Issue
Block a user