c->state = PA_CORE_STARTUP;
c->mainloop = m;
+
c->clients = pa_idxset_new(NULL, NULL);
+ c->cards = pa_idxset_new(NULL, NULL);
c->sinks = pa_idxset_new(NULL, NULL);
c->sources = pa_idxset_new(NULL, NULL);
- c->source_outputs = pa_idxset_new(NULL, NULL);
c->sink_inputs = pa_idxset_new(NULL, NULL);
- c->cards = pa_idxset_new(NULL, NULL);
+ c->source_outputs = pa_idxset_new(NULL, NULL);
+ c->modules = pa_idxset_new(NULL, NULL);
+ c->scache = pa_idxset_new(NULL, NULL);
+
+ c->namereg = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+ c->shared = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
c->default_source = NULL;
c->default_sink = NULL;
- c->modules = NULL;
- c->namereg = NULL;
- c->scache = NULL;
- c->running_as_daemon = FALSE;
-
c->default_sample_spec.format = PA_SAMPLE_S16NE;
c->default_sample_spec.rate = 44100;
c->default_sample_spec.channels = 2;
+ pa_channel_map_init_extend(&c->default_channel_map, c->default_sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
c->default_n_fragments = 4;
c->default_fragment_size_msec = 25;
c->exit_idle_time = -1;
c->scache_idle_time = 20;
- c->flat_volumes = TRUE;
-
- c->resample_method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
+ c->flat_volumes = TRUE;
c->disallow_module_loading = FALSE;
c->disallow_exit = FALSE;
+ c->running_as_daemon = FALSE;
c->realtime_scheduling = FALSE;
c->realtime_priority = 5;
c->disable_remixing = FALSE;
c->disable_lfe_remixing = FALSE;
+ c->resample_method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
pa_hook_init(&c->hooks[j], c);
- pa_shared_init(c);
-
pa_random(&c->cookie, sizeof(c->cookie));
#ifdef SIGPIPE
c->state = PA_CORE_SHUTDOWN;
pa_module_unload_all(c);
- pa_assert(!c->modules);
+ pa_scache_free_all(c);
+
+ pa_assert(pa_idxset_isempty(c->scache));
+ pa_idxset_free(c->scache, NULL, NULL);
+
+ pa_assert(pa_idxset_isempty(c->modules));
+ pa_idxset_free(c->modules, NULL, NULL);
pa_assert(pa_idxset_isempty(c->clients));
pa_idxset_free(c->clients, NULL, NULL);
pa_assert(pa_idxset_isempty(c->sink_inputs));
pa_idxset_free(c->sink_inputs, NULL, NULL);
- pa_scache_free(c);
- pa_namereg_free(c);
+ pa_assert(pa_hashmap_isempty(c->namereg));
+ pa_hashmap_free(c->namereg, NULL, NULL);
+
+ pa_assert(pa_hashmap_isempty(c->shared));
+ pa_hashmap_free(c->shared, NULL, NULL);
+
pa_subscription_free_all(c);
if (c->exit_event)
pa_silence_cache_done(&c->silence_cache);
pa_mempool_free(c->mempool);
- pa_shared_cleanup(c);
-
for (j = 0; j < PA_CORE_HOOK_MAX; j++)
pa_hook_done(&c->hooks[j]);