diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-04-26 15:40:14 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-04-26 15:40:14 +0000 |
commit | 185a57cadd7b4e8e85c7fbecc866d7c279704e12 (patch) | |
tree | 41414796a864bf51b65bab997dafb40c1cef07f1 /src/modules/module-alsa-source.c | |
parent | fbb0d1436c5c415e3964d57b0dedaa0d8817c289 (diff) |
support new channel_map argument in sink/source modules
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@803 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-alsa-source.c')
-rw-r--r-- | src/modules/module-alsa-source.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c index 7a365286..e4938917 100644 --- a/src/modules/module-alsa-source.c +++ b/src/modules/module-alsa-source.c @@ -50,7 +50,15 @@ PA_MODULE_AUTHOR("Lennart Poettering") PA_MODULE_DESCRIPTION("ALSA Source") PA_MODULE_VERSION(PACKAGE_VERSION) -PA_MODULE_USAGE("source_name=<name for the source> device=<ALSA device> format=<sample format> channels=<number of channels> rate=<sample rate> fragments=<number of fragments> fragment_size=<fragment size>") +PA_MODULE_USAGE( + "source_name=<name for the source> " + "device=<ALSA device> " + "format=<sample format> " + "channels=<number of channels> " + "rate=<sample rate> " + "fragments=<number of fragments> " + "fragment_size=<fragment size> " + "channel_map=<channel map>") struct userdata { snd_pcm_t *pcm_handle; @@ -74,6 +82,7 @@ static const char* const valid_modargs[] = { "format", "fragments", "fragment_size", + "channel_map", NULL }; @@ -287,6 +296,7 @@ int pa__init(pa_core *c, pa_module*m) { struct userdata *u = NULL; const char *dev; pa_sample_spec ss; + pa_channel_map map; unsigned periods, fragsize; snd_pcm_uframes_t period_size; size_t frame_size; @@ -299,7 +309,7 @@ int pa__init(pa_core *c, pa_module*m) { } ss = c->default_sample_spec; - if (pa_modargs_get_sample_spec(ma, &ss) < 0) { + if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map) < 0) { pa_log(__FILE__": failed to parse sample specification"); goto fail; } @@ -345,7 +355,7 @@ int pa__init(pa_core *c, pa_module*m) { u->mixer_handle = NULL; } - u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, NULL); + u->source = pa_source_new(c, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, &map); assert(u->source); u->source->userdata = u; |