summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/core-scache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-29 16:25:29 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-29 16:25:29 +0100
commit746dc2ac19950d4eecc083929d6ed86443e3a112 (patch)
tree558d6fa8052ca28f3f6af7d8ccf7b5fbca7a7570 /src/pulsecore/core-scache.c
parent4a06af6081c0fc081ad6ca136880a61ebe1c4e01 (diff)
get rid of nonsensical late initialization of namereg/scache and things
Diffstat (limited to 'src/pulsecore/core-scache.c')
-rw-r--r--src/pulsecore/core-scache.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index 6d2ae932..e5489415 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.c
@@ -120,9 +120,6 @@ static pa_scache_entry* scache_add_item(pa_core *c, const char *name) {
e->core = c;
e->proplist = pa_proplist_new();
- if (!c->scache)
- c->scache = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
-
pa_idxset_put(c->scache, e, &e->index);
pa_subscription_post(c, PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE|PA_SUBSCRIPTION_EVENT_NEW, e->index);
@@ -287,23 +284,18 @@ int pa_scache_remove_item(pa_core *c, const char *name) {
return 0;
}
-static void free_cb(void *p, void *userdata) {
- pa_scache_entry *e = p;
- pa_assert(e);
-
- free_entry(e);
-}
+void pa_scache_free_all(pa_core *c) {
+ pa_scache_entry *e;
-void pa_scache_free(pa_core *c) {
pa_assert(c);
- if (c->scache) {
- pa_idxset_free(c->scache, free_cb, NULL);
- c->scache = NULL;
- }
+ while ((e = pa_idxset_steal_first(c->scache, NULL)))
+ free_entry(e);
- if (c->scache_auto_unload_event)
+ if (c->scache_auto_unload_event) {
c->mainloop->time_free(c->scache_auto_unload_event);
+ c->scache_auto_unload_event = NULL;
+ }
}
int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t volume, pa_proplist *p, uint32_t *sink_input_idx) {