summaryrefslogtreecommitdiffstats
path: root/polyp/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'polyp/core.c')
-rw-r--r--polyp/core.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/polyp/core.c b/polyp/core.c
index 1c69f914..ffc11cec 100644
--- a/polyp/core.c
+++ b/polyp/core.c
@@ -34,11 +34,12 @@
#include "namereg.h"
#include "util.h"
#include "scache.h"
+#include "autoload.h"
+#include "xmalloc.h"
struct pa_core* pa_core_new(struct pa_mainloop_api *m) {
struct pa_core* c;
- c = malloc(sizeof(struct pa_core));
- assert(c);
+ c = pa_xmalloc(sizeof(struct pa_core));
c->mainloop = m;
c->clients = pa_idxset_new(NULL, NULL);
@@ -47,16 +48,20 @@ struct pa_core* pa_core_new(struct pa_mainloop_api *m) {
c->source_outputs = pa_idxset_new(NULL, NULL);
c->sink_inputs = pa_idxset_new(NULL, NULL);
- c->default_source_index = c->default_sink_index = PA_IDXSET_INVALID;
+ c->default_source_name = c->default_sink_name = NULL;
c->modules = NULL;
c->namereg = NULL;
c->scache_idxset = NULL;
c->scache_hashmap = NULL;
+ c->autoload_hashmap = NULL;
+
c->default_sample_spec.format = PA_SAMPLE_S16NE;
c->default_sample_spec.rate = 44100;
c->default_sample_spec.channels = 2;
+
+ c->auto_unload_time = 20;
pa_check_for_sigpipe();
@@ -68,7 +73,7 @@ void pa_core_free(struct pa_core *c) {
pa_module_unload_all(c);
assert(!c->modules);
-
+
assert(pa_idxset_isempty(c->clients));
pa_idxset_free(c->clients, NULL, NULL);
@@ -86,7 +91,11 @@ void pa_core_free(struct pa_core *c) {
pa_namereg_free(c);
pa_scache_free(c);
+ pa_autoload_free(c);
+
+ pa_xfree(c->default_source_name);
+ pa_xfree(c->default_sink_name);
- free(c);
+ pa_xfree(c);
};