summaryrefslogtreecommitdiffstats
path: root/src/modules/module-alsa-source.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/module-alsa-source.c')
-rw-r--r--src/modules/module-alsa-source.c16
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;