summaryrefslogtreecommitdiffstats
path: root/src/modules/module-remap-sink.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-19 19:23:14 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-19 19:23:14 +0200
commit11e55fe01fcf85f9954577795b0517eac8373390 (patch)
tree3a803ba1b10ea18dfe69981dd111f64807e9e702 /src/modules/module-remap-sink.c
parentfd5a1b1722fd4200065b26f5548464637da74911 (diff)
add new remix= parameter to remap sink
Diffstat (limited to 'src/modules/module-remap-sink.c')
-rw-r--r--src/modules/module-remap-sink.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 7cb516db..b9e73013 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -49,7 +49,8 @@ PA_MODULE_USAGE(
"format=<sample format> "
"channels=<number of channels> "
"rate=<sample rate> "
- "channel_map=<channel map>");
+ "channel_map=<channel map> "
+ "remix=<remix channels?>");
struct userdata {
pa_core *core;
@@ -67,6 +68,7 @@ static const char* const valid_modargs[] = {
"format",
"channels",
"channel_map",
+ "remix",
NULL
};
@@ -258,6 +260,7 @@ int pa__init(pa_module*m) {
pa_sink *master;
pa_sink_input_new_data sink_input_data;
pa_sink_new_data sink_data;
+ pa_bool_t remix = TRUE;
pa_assert(m);
@@ -280,7 +283,7 @@ int pa__init(pa_module*m) {
stream_map = sink_map;
if (pa_modargs_get_channel_map(ma, "master_channel_map", &stream_map) < 0) {
- pa_log("Invalid master hannel map");
+ pa_log("Invalid master channel map");
goto fail;
}
@@ -292,6 +295,11 @@ int pa__init(pa_module*m) {
if (pa_channel_map_equal(&stream_map, &master->channel_map))
pa_log_warn("No remapping configured, proceeding nonetheless!");
+ if (pa_modargs_get_value_boolean(ma, "remix", &remix) < 0) {
+ pa_log("Invalid boolean remix parameter");
+ goto fail;
+ }
+
u = pa_xnew0(struct userdata, 1);
u->core = m->core;
u->module = m;
@@ -340,7 +348,7 @@ int pa__init(pa_module*m) {
pa_sink_input_new_data_set_sample_spec(&sink_input_data, &ss);
pa_sink_input_new_data_set_channel_map(&sink_input_data, &stream_map);
- u->sink_input = pa_sink_input_new(m->core, &sink_input_data, PA_SINK_INPUT_DONT_MOVE);
+ u->sink_input = pa_sink_input_new(m->core, &sink_input_data, PA_SINK_INPUT_DONT_MOVE | (remix ? PA_SINK_INPUT_NO_REMIX : 0));
pa_sink_input_new_data_done(&sink_input_data);
if (!u->sink_input)