[pulseaudio-commits] src/pulsecore
Arun Raghavan
arun at kemper.freedesktop.org
Mon Oct 10 03:39:04 PDT 2011
src/pulsecore/namereg.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
New commits:
commit 5c28acb1db4ae0acc8b79f8da4ce7c3501ac20d3
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date: Wed Sep 28 14:28:32 2011 +0530
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
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;
}
More information about the pulseaudio-commits
mailing list