From 5c28acb1db4ae0acc8b79f8da4ce7c3501ac20d3 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Wed, 28 Sep 2011 14:28:32 +0530 Subject: [PATCH] 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 --- 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 d982187..334e00d 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; } -- 1.7.6.1