summaryrefslogtreecommitdiff
path: root/src/pulsecore
diff options
context:
space:
mode:
authorDavid Mandelberg <dseomn@google.com>2017-01-04 11:55:49 -0500
committerTanu Kaskinen <tanuk@iki.fi>2017-01-19 03:00:45 +0200
commit6e6f497219a4b86595a5d4e3ea02cbe2c82ca75d (patch)
tree214f32258ea5a306eb395a3cca7784ab0f6ca666 /src/pulsecore
parent6ec4ca218e0cca8ef9f0785736edf04ada4c0b7b (diff)
daemon-conf: add remixing-use-all-sink-channels option
This option controls the PA_RESAMPLER_NO_FILL_SINK flag added in a previous commit. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=62588 BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=94563
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/core.c1
-rw-r--r--src/pulsecore/core.h1
-rw-r--r--src/pulsecore/sink-input.c2
-rw-r--r--src/pulsecore/source-output.c2
4 files changed, 6 insertions, 0 deletions
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index 2a96dfa5..afdb0a4c 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.c
@@ -142,6 +142,7 @@ pa_core* pa_core_new(pa_mainloop_api *m, bool shared, bool enable_memfd, size_t
c->realtime_scheduling = false;
c->realtime_priority = 5;
c->disable_remixing = false;
+ c->remixing_use_all_sink_channels = true;
c->disable_lfe_remixing = true;
c->lfe_crossover_freq = 0;
c->deferred_volume = true;
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 802111ba..d2fe887c 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.h
@@ -200,6 +200,7 @@ struct pa_core {
bool running_as_daemon:1;
bool realtime_scheduling:1;
bool disable_remixing:1;
+ bool remixing_use_all_sink_channels:1;
bool disable_lfe_remixing:1;
bool deferred_volume:1;
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index e9694f21..b937383e 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -456,6 +456,7 @@ int pa_sink_input_new(
((data->flags & PA_SINK_INPUT_VARIABLE_RATE) ? PA_RESAMPLER_VARIABLE_RATE : 0) |
((data->flags & PA_SINK_INPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(core->disable_remixing || (data->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
+ (core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
(core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0)))) {
pa_log_warn("Unsupported resampling operation.");
return -PA_ERR_NOTSUPPORTED;
@@ -2259,6 +2260,7 @@ int pa_sink_input_update_rate(pa_sink_input *i) {
((i->flags & PA_SINK_INPUT_VARIABLE_RATE) ? PA_RESAMPLER_VARIABLE_RATE : 0) |
((i->flags & PA_SINK_INPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(i->core->disable_remixing || (i->flags & PA_SINK_INPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
+ (i->core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
(i->core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0));
if (!new_resampler) {
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 6714ea93..0ba19c82 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -401,6 +401,7 @@ int pa_source_output_new(
((data->flags & PA_SOURCE_OUTPUT_VARIABLE_RATE) ? PA_RESAMPLER_VARIABLE_RATE : 0) |
((data->flags & PA_SOURCE_OUTPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(core->disable_remixing || (data->flags & PA_SOURCE_OUTPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
+ (core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
(core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0)))) {
pa_log_warn("Unsupported resampling operation.");
return -PA_ERR_NOTSUPPORTED;
@@ -1714,6 +1715,7 @@ int pa_source_output_update_rate(pa_source_output *o) {
((o->flags & PA_SOURCE_OUTPUT_VARIABLE_RATE) ? PA_RESAMPLER_VARIABLE_RATE : 0) |
((o->flags & PA_SOURCE_OUTPUT_NO_REMAP) ? PA_RESAMPLER_NO_REMAP : 0) |
(o->core->disable_remixing || (o->flags & PA_SOURCE_OUTPUT_NO_REMIX) ? PA_RESAMPLER_NO_REMIX : 0) |
+ (o->core->remixing_use_all_sink_channels ? 0 : PA_RESAMPLER_NO_FILL_SINK) |
(o->core->disable_lfe_remixing ? PA_RESAMPLER_NO_LFE : 0));
if (!new_resampler) {