From 11e55fe01fcf85f9954577795b0517eac8373390 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Jun 2008 19:23:14 +0200 Subject: add new remix= parameter to remap sink --- src/modules/module-remap-sink.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/modules/module-remap-sink.c') 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= " "channels= " "rate= " - "channel_map="); + "channel_map= " + "remix="); 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) -- cgit