From e1f008f2a395422b0f1e0c931ea1550df853e6e4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 15 Sep 2005 23:42:56 +0000 Subject: commit liboil porting changes git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/liboil-test@344 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/source.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'polyp/source.c') diff --git a/polyp/source.c b/polyp/source.c index fc73272c..a80c6af7 100644 --- a/polyp/source.c +++ b/polyp/source.c @@ -35,11 +35,22 @@ #include "subscribe.h" #include "log.h" -struct pa_source* pa_source_new(struct pa_core *core, pa_typeid_t typeid, const char *name, int fail, const struct pa_sample_spec *spec) { +struct pa_source* pa_source_new( + struct pa_core *core, + const char *name, + const char *driver, + int fail, + const struct pa_sample_spec *spec, + const struct pa_channel_map *map) { + struct pa_source *s; char st[256]; int r; - assert(core && spec && name && *name); + + assert(core); + assert(name); + assert(*name); + assert(spec); s = pa_xmalloc(sizeof(struct pa_source)); @@ -53,11 +64,16 @@ struct pa_source* pa_source_new(struct pa_core *core, pa_typeid_t typeid, const s->name = pa_xstrdup(name); s->description = NULL; - s->typeid = typeid; + s->driver = pa_xstrdup(driver); s->owner = NULL; s->core = core; s->sample_spec = *spec; + if (map) + s->channel_map = *map; + else + pa_channel_map_init_auto(&s->channel_map, spec->channels); + s->outputs = pa_idxset_new(NULL, NULL); s->monitor_of = NULL; @@ -108,6 +124,7 @@ static void source_free(struct pa_source *s) { pa_xfree(s->name); pa_xfree(s->description); + pa_xfree(s->driver); pa_xfree(s); } -- cgit