introduce pa_xmalloc() and friends

implement module auto loading


git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@103 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-08-04 16:39:30 +00:00
parent 24291aff27
commit 46091a9237
61 changed files with 700 additions and 631 deletions

View file

@ -28,6 +28,7 @@
#include <string.h>
#include "source-output.h"
#include "xmalloc.h"
struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *name, const struct pa_sample_spec *spec) {
struct pa_source_output *o;
@ -39,9 +40,8 @@ struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *n
if (!(resampler = pa_resampler_new(&s->sample_spec, spec)))
return NULL;
o = malloc(sizeof(struct pa_source_output));
assert(o);
o->name = name ? strdup(name) : NULL;
o = pa_xmalloc(sizeof(struct pa_source_output));
o->name = pa_xstrdup(name);
o->client = NULL;
o->owner = NULL;
o->source = s;
@ -71,8 +71,8 @@ void pa_source_output_free(struct pa_source_output* o) {
if (o->resampler)
pa_resampler_free(o->resampler);
free(o->name);
free(o);
pa_xfree(o->name);
pa_xfree(o);
}
void pa_source_output_kill(struct pa_source_output*i) {