summaryrefslogtreecommitdiffstats
path: root/polyp/namereg.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-08-19 23:14:59 +0000
committerLennart Poettering <lennart@poettering.net>2004-08-19 23:14:59 +0000
commitf9b58fb0eafdc332e500a0851b0506146c2b14cd (patch)
tree3f4b197fdd9e21af7ad404de9dff61ed845a4154 /polyp/namereg.c
parente0fe68a2d4e967c2b3d7afd300c854d173dcd95b (diff)
move sample cache to namereg
documentation git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@141 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/namereg.c')
-rw-r--r--polyp/namereg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/polyp/namereg.c b/polyp/namereg.c
index b6a8c23f..72a4c648 100644
--- a/polyp/namereg.c
+++ b/polyp/namereg.c
@@ -134,8 +134,7 @@ void* pa_namereg_get(struct pa_core *c, const char *name, enum pa_namereg_type t
name = c->default_source_name;
- } else {
- assert(type == PA_NAMEREG_SINK);
+ } else if (type == PA_NAMEREG_SINK) {
if (!c->default_sink_name) {
struct pa_sink *s;
@@ -174,13 +173,15 @@ void* pa_namereg_get(struct pa_core *c, const char *name, enum pa_namereg_type t
d = pa_idxset_get_by_index(c->sinks, index);
else if (type == PA_NAMEREG_SOURCE)
d = pa_idxset_get_by_index(c->sources, index);
-
+ else if (type == PA_NAMEREG_SAMPLE && c->scache)
+ d = pa_idxset_get_by_index(c->scache, index);
+
return d;
}
void pa_namereg_set_default(struct pa_core*c, const char *name, enum pa_namereg_type type) {
char **s;
- assert(c);
+ assert(c && (type == PA_NAMEREG_SINK || type == PA_NAMEREG_SOURCE));
s = type == PA_NAMEREG_SINK ? &c->default_sink_name : &c->default_source_name;
assert(s);