mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
Allow read-only or non-existing sink input volume.
There are two known cases where read-only or non-existing sink input volume is relevant: passthrough streams and the planned volume sharing logic. Passthrough streams don't have volume at all, and the volume sharing logic requires read-only sink input volume. This commit is primarily working towards the volume sharing feature, but support for non-existing sink input volume is also added, because it is so closely related to read-only volume. Some unrelated refactoring in iface-stream.c creeped into this commit too (new function: stream_to_string()).
This commit is contained in:
parent
fa12d2a8a8
commit
99ddca89cd
9 changed files with 156 additions and 63 deletions
|
|
@ -579,11 +579,16 @@ static int pa_cli_command_sink_input_volume(pa_core *c, pa_tokenizer *t, pa_strb
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!(si = pa_idxset_get_by_index(c->sink_inputs, (uint32_t) idx))) {
|
||||
if (!(si = pa_idxset_get_by_index(c->sink_inputs, idx))) {
|
||||
pa_strbuf_puts(buf, "No sink input found with this index.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!pa_sink_input_is_volume_writable(si)) {
|
||||
pa_strbuf_puts(buf, "This sink input's volume can't be changed.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pa_cvolume_set(&cvolume, 1, volume);
|
||||
pa_sink_input_set_volume(si, &cvolume, TRUE, TRUE);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue