summaryrefslogtreecommitdiffstats
path: root/polyp/source-output.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-09-15 23:42:56 +0000
committerLennart Poettering <lennart@poettering.net>2005-09-15 23:42:56 +0000
commite1f008f2a395422b0f1e0c931ea1550df853e6e4 (patch)
tree6b130f01398ec72d2166c9bd484cf53cc2632ee7 /polyp/source-output.c
parent0c9873e5b3212adc273400ff133e040080ee4b65 (diff)
commit liboil porting changes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/liboil-test@344 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/source-output.c')
-rw-r--r--polyp/source-output.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/polyp/source-output.c b/polyp/source-output.c
index f954c23f..fa9f252f 100644
--- a/polyp/source-output.c
+++ b/polyp/source-output.c
@@ -33,7 +33,14 @@
#include "subscribe.h"
#include "log.h"
-struct pa_source_output* pa_source_output_new(struct pa_source *s, pa_typeid_t typeid, const char *name, const struct pa_sample_spec *spec, int resample_method) {
+struct pa_source_output* pa_source_output_new(
+ struct pa_source *s,
+ const char *name,
+ const char *driver,
+ const struct pa_sample_spec *spec,
+ const struct pa_channel_map *map,
+ int resample_method) {
+
struct pa_source_output *o;
struct pa_resampler *resampler = NULL;
int r;
@@ -49,19 +56,24 @@ struct pa_source_output* pa_source_output_new(struct pa_source *s, pa_typeid_t t
resample_method = s->core->resample_method;
if (!pa_sample_spec_equal(&s->sample_spec, spec))
- if (!(resampler = pa_resampler_new(&s->sample_spec, spec, s->core->memblock_stat, resample_method)))
+ if (!(resampler = pa_resampler_new(&s->sample_spec, &s->channel_map, spec, map, s->core->memblock_stat, resample_method)))
return NULL;
o = pa_xmalloc(sizeof(struct pa_source_output));
o->ref = 1;
o->state = PA_SOURCE_OUTPUT_RUNNING;
o->name = pa_xstrdup(name);
- o->typeid = typeid;
+ o->driver = pa_xstrdup(driver);
o->client = NULL;
o->owner = NULL;
o->source = s;
+
o->sample_spec = *spec;
+ if (map)
+ c->channel_map = *map;
+ else
+ pa_channel_map_init_auto(&c->channel_map, spec->channels);
o->push = NULL;
o->kill = NULL;
@@ -96,7 +108,6 @@ void pa_source_output_disconnect(struct pa_source_output*o) {
o->push = NULL;
o->kill = NULL;
-
o->state = PA_SOURCE_OUTPUT_DISCONNECTED;
}
@@ -112,6 +123,7 @@ static void source_output_free(struct pa_source_output* o) {
pa_resampler_free(o->resampler);
pa_xfree(o->name);
+ pa_xfree(o->driver);
pa_xfree(o);
}