diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-09-28 14:28:32 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-10-10 16:08:43 +0530 |
commit | 5c28acb1db4ae0acc8b79f8da4ce7c3501ac20d3 (patch) | |
tree | 0ea77c235a8ff31a5a48ec41de90b94da594589f | |
parent | f1e41a78ccb33d471aabf8c3c9274962780f6f92 (diff) |
namereg: Don't set default sink/source on get()
This removes the nasty side-effect that a call to
pa_namereg_get_default_{source,sink}() will also *set* the default
source/sink.
This is a more complete fix for commit 766dbc68 ("conf: Make sure
module-dbus-protocol is loaded after module-default-device-restore")
https://bugs.freedesktop.org/show_bug.cgi?id=40897
-rw-r--r-- | src/pulsecore/namereg.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/pulsecore/namereg.c b/src/pulsecore/namereg.c index d98218761..334e00d35 100644 --- a/src/pulsecore/namereg.c +++ b/src/pulsecore/namereg.c @@ -293,10 +293,7 @@ pa_sink *pa_namereg_get_default_sink(pa_core *c) { if (!best || s->priority > best->priority) best = s; - if (best) - return pa_namereg_set_default_sink(c, best); - - return NULL; + return best; } pa_source *pa_namereg_get_default_source(pa_core *c) { @@ -316,7 +313,7 @@ pa_source *pa_namereg_get_default_source(pa_core *c) { best = s; if (best) - return pa_namereg_set_default_source(c, best); + return best; /* Then, fallback to a monitor */ PA_IDXSET_FOREACH(s, c->sources, idx) @@ -329,8 +326,5 @@ pa_source *pa_namereg_get_default_source(pa_core *c) { s->monitor_of->priority > best->monitor_of->priority)) best = s; - if (best) - return pa_namereg_set_default_source(c, best); - - return NULL; + return best; } |