[pulseaudio-commits] r1664 - /branches/lennart/src/pulsecore/cli-command.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Wed Aug 15 12:27:14 PDT 2007
Author: lennart
Date: Wed Aug 15 21:27:12 2007
New Revision: 1664
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1664&root=3Dpulseaudio&vi=
ew=3Drev
Log:
use pa_source_suspend_all/pa_sink_suspend_all for suspending all sinks/sour=
ces
Modified:
branches/lennart/src/pulsecore/cli-command.c
Modified: branches/lennart/src/pulsecore/cli-command.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
cli-command.c?rev=3D1664&root=3Dpulseaudio&r1=3D1663&r2=3D1664&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/cli-command.c (original)
+++ branches/lennart/src/pulsecore/cli-command.c Wed Aug 15 21:27:12 2007
@@ -965,10 +965,8 @@
=
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *=
buf, int *fail) {
const char *m;
- pa_sink *sink;
- pa_source *source;
int suspend;
- uint32_t idx;
+ int ret;
=
if (!(m =3D pa_tokenizer_get(t, 1))) {
pa_strbuf_puts(buf, "You need to specify a suspend switch setting =
(0/1).\n");
@@ -980,11 +978,12 @@
return -1;
}
=
- for (sink =3D pa_idxset_first(c->sinks, &idx); sink; sink =3D pa_idxse=
t_next(c->sinks, &idx))
- pa_sink_suspend(sink, suspend);
-
- for (source =3D pa_idxset_first(c->sources, &idx); source; source =3D =
pa_idxset_next(c->sources, &idx))
- pa_source_suspend(source, suspend);
+ ret =3D - (pa_sink_suspend_all(c, suspend) < 0);
+ if (pa_source_suspend_all(c, suspend) < 0)
+ ret =3D -1;
+
+ if (ret < 0)
+ pa_strbuf_puts(buf, "Failed to resume/suspend all sinks/sources.\n=
");
=
return 0;
}
More information about the pulseaudio-commits
mailing list