mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
when determining the minimum volume of all sink inputs make sure to handle the case when there are no sink inputs correctly
This commit is contained in:
parent
55e6331bed
commit
8fbce6eb89
1 changed files with 13 additions and 0 deletions
|
|
@ -926,12 +926,24 @@ void pa_sink_update_flat_volume(pa_sink *s, pa_cvolume *new_volume) {
|
|||
pa_sink_input *i;
|
||||
uint32_t idx;
|
||||
|
||||
pa_sink_assert_ref(s);
|
||||
pa_assert(new_volume);
|
||||
pa_assert(PA_SINK_IS_LINKED(s->state));
|
||||
pa_assert(s->flags & PA_SINK_FLAT_VOLUME);
|
||||
|
||||
/* This is called whenever a sink input volume changes and we
|
||||
* might need to fix up the sink volume accordingly. Please note
|
||||
* that we don't actually update the sinks volume here, we only
|
||||
* return how it needs to be updated. The caller should then call
|
||||
* pa_sink_set_flat_volume().*/
|
||||
|
||||
if (pa_idxset_isempty(s->inputs)) {
|
||||
/* In the special case that we have no sink input we leave the
|
||||
* volume unmodified. */
|
||||
*new_volume = s->virtual_volume;
|
||||
return;
|
||||
}
|
||||
|
||||
pa_cvolume_mute(new_volume, s->channel_map.channels);
|
||||
|
||||
/* First let's determine the new maximum volume of all inputs
|
||||
|
|
@ -1133,6 +1145,7 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
|
|||
pa_bool_t pa_sink_update_proplist(pa_sink *s, pa_update_mode_t mode, pa_proplist *p) {
|
||||
|
||||
pa_sink_assert_ref(s);
|
||||
pa_assert(p);
|
||||
|
||||
pa_proplist_update(s->proplist, mode, p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue