diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2017-06-30 00:09:34 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2017-07-17 19:41:03 +0300 |
commit | a448cc587c203bba42b1b9805317088e95775f71 (patch) | |
tree | 1d4e594c5772be81498c1967cd210c621c1bff08 /src/pulsecore/cli-command.c | |
parent | abdd14d5e02204df411946751b206c07a3ea798b (diff) | |
download | pulseaudio-a448cc587c203bba42b1b9805317088e95775f71.tar.gz |
core: change configured_default_sink/source type to string
This allows us to restore the default device properly when a
hotpluggable device (e.g. a USB sound card) is set as the default, but
unplugged temporarily. Previously we would forget that the unplugged
device was ever set as the default, because we had to set
configured_default_sink to NULL to avoid having a stale pa_sink pointer,
and also because module-default-device-restore couldn't resolve the name
of a currently-unplugged device to a pa_sink pointer.
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=89934
Diffstat (limited to 'src/pulsecore/cli-command.c')
-rw-r--r-- | src/pulsecore/cli-command.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c index 5a632be45..01fea475b 100644 --- a/src/pulsecore/cli-command.c +++ b/src/pulsecore/cli-command.c @@ -1030,7 +1030,7 @@ static int pa_cli_command_sink_default(pa_core *c, pa_tokenizer *t, pa_strbuf *b } if ((s = pa_namereg_get(c, n, PA_NAMEREG_SINK))) - pa_core_set_configured_default_sink(c, s); + pa_core_set_configured_default_sink(c, s->name); else pa_strbuf_printf(buf, "Sink %s does not exist.\n", n); @@ -1052,7 +1052,7 @@ static int pa_cli_command_source_default(pa_core *c, pa_tokenizer *t, pa_strbuf } if ((s = pa_namereg_get(c, n, PA_NAMEREG_SOURCE))) - pa_core_set_configured_default_source(c, s); + pa_core_set_configured_default_source(c, s->name); else pa_strbuf_printf(buf, "Source %s does not exist.\n", n); return 0; |