diff options
Diffstat (limited to 'src/pulsecore/cli-command.c')
-rw-r--r-- | src/pulsecore/cli-command.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c index a18ebd33..de4995eb 100644 --- a/src/pulsecore/cli-command.c +++ b/src/pulsecore/cli-command.c @@ -32,6 +32,7 @@ #include <ltdl.h> #include <sys/stat.h> #include <dirent.h> +#include <time.h> #include <pulse/xmalloc.h> #include <pulse/error.h> @@ -579,11 +580,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; |