[player/dacp/mpd/json] Update master volume after setting speaker volume

Changing a speaker volume in a DACP clients results in two dacp requests
(at least in Retune):

setproperty?include-speaker-id=0&dmcp.volume=41
setproperty?speaker-id=198018693182577&dmcp.volume=43

The first request sets the absolute volume for the speaker (player.c -
volume_setabs_speaker). The second request is only triggered if the
volume from the first one is not the new master volume. This second
requests adjusts the relativ volume based on the loudest device (new
master volume) (player.c - volume_setrel_speaker). After the second
request the master volume and the relative volumes are correct (range
from 0 - 100 percent and master volume is 100 percent).

MPD and JSON API clients only set the absolute volume which results in
inconsistent master_volume and relative volumes. The added option to
update the master volume in volume_setabs_speaker/volume_setrel_speaker
makes sure the master volume and the relative volumes are correctly set.
This commit is contained in:
chme 2018-05-26 10:55:51 +02:00 committed by ejurgensen
parent 3d779e1273
commit 705b7013c3
2 changed files with 6 additions and 0 deletions

View File

@ -31,6 +31,7 @@
#endif
#include <regex.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

View File

@ -2684,6 +2684,8 @@ volume_setrel_speaker(void *arg, int *retval)
break;
}
volume_master_find();
#ifdef DEBUG_RELVOL
debug_print_speaker();
#endif
@ -2737,9 +2739,12 @@ volume_setabs_speaker(void *arg, int *retval)
}
}
volume_master_find();
#ifdef DEBUG_RELVOL
debug_print_speaker();
#endif
listener_notify(LISTENER_VOLUME);
if (*retval > 0)