mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-07 13:30:03 -05:00
use pa_source_suspend_all/pa_sink_suspend_all for suspending all sinks/sources
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1664 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
a74e804973
commit
b20d204a30
1 changed files with 6 additions and 7 deletions
|
|
@ -965,10 +965,8 @@ static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf
|
||||||
|
|
||||||
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail) {
|
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, int *fail) {
|
||||||
const char *m;
|
const char *m;
|
||||||
pa_sink *sink;
|
|
||||||
pa_source *source;
|
|
||||||
int suspend;
|
int suspend;
|
||||||
uint32_t idx;
|
int ret;
|
||||||
|
|
||||||
if (!(m = pa_tokenizer_get(t, 1))) {
|
if (!(m = pa_tokenizer_get(t, 1))) {
|
||||||
pa_strbuf_puts(buf, "You need to specify a suspend switch setting (0/1).\n");
|
pa_strbuf_puts(buf, "You need to specify a suspend switch setting (0/1).\n");
|
||||||
|
|
@ -980,11 +978,12 @@ static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, i
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (sink = pa_idxset_first(c->sinks, &idx); sink; sink = pa_idxset_next(c->sinks, &idx))
|
ret = - (pa_sink_suspend_all(c, suspend) < 0);
|
||||||
pa_sink_suspend(sink, suspend);
|
if (pa_source_suspend_all(c, suspend) < 0)
|
||||||
|
ret = -1;
|
||||||
|
|
||||||
for (source = pa_idxset_first(c->sources, &idx); source; source = pa_idxset_next(c->sources, &idx))
|
if (ret < 0)
|
||||||
pa_source_suspend(source, suspend);
|
pa_strbuf_puts(buf, "Failed to resume/suspend all sinks/sources.\n");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue