summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2007-10-25 05:49:11 +0000
committerTanu Kaskinen <tanuk@iki.fi>2007-10-25 05:49:11 +0000
commit7ccf40ee3bb2d91e6fad6e40acaa7ac9e2e1b4fb (patch)
treeff4466d2f42aaa4a86cfbc7a91b4c1407abe4b42 /src/modules
parent81ed6e6c6f10796f7111318a7029d80bce3028dd (diff)
Add "support" for plugins that have control output ports, i.e. don't crash on them anymore (the plugins correctly assume that every port is connected to a buffer, so we connect them to a dummy buffer that isn't used anywhere).
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1952 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/module-ladspa-sink.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 29ca89f0..0265d971 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -21,6 +21,9 @@
USA.
***/
+/* TODO: Some plugins cause latency, and some even report it by using a control
+ out port. We don't currently use the latency information. */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -71,6 +74,10 @@ struct userdata {
unsigned long input_port, output_port;
LADSPA_Data *control;
+ /* This is a dummy buffer. Every port must be connected, but we don't care
+ about control out ports. We connect them all to this single buffer. */
+ LADSPA_Data control_out;
+
pa_memchunk memchunk;
};
@@ -386,8 +393,10 @@ int pa__init(pa_module*m) {
} else if (LADSPA_IS_PORT_INPUT(d->PortDescriptors[p]) && LADSPA_IS_PORT_CONTROL(d->PortDescriptors[p]))
n_control++;
- else
- pa_log("Cannot handle type of port %s", d->PortNames[p]);
+ else {
+ pa_assert(LADSPA_IS_PORT_OUTPUT(d->PortDescriptors[p]) && LADSPA_IS_PORT_CONTROL(d->PortDescriptors[p]));
+ pa_log_info("Ignored port \"%s\", because we ignore all control out ports.", d->PortNames[p]);
+ }
}
if ((input_port == (unsigned long) -1) || (output_port == (unsigned long) -1)) {
@@ -466,9 +475,15 @@ int pa__init(pa_module*m) {
for (p = 0; p < d->PortCount; p++) {
LADSPA_PortRangeHintDescriptor hint = d->PortRangeHints[p].HintDescriptor;
- if (!LADSPA_IS_PORT_INPUT(d->PortDescriptors[p]) || !LADSPA_IS_PORT_CONTROL(d->PortDescriptors[p]))
+ if (!LADSPA_IS_PORT_CONTROL(d->PortDescriptors[p]))
continue;
+ if (LADSPA_IS_PORT_OUTPUT(d->PortDescriptors[p])) {
+ for (c = 0; c < ss.channels; c++)
+ d->connect_port(u->handle[c], p, &u->control_out);
+ continue;
+ }
+
pa_assert(h < n_control);
if (use_default[h]) {