[pulseaudio-commits] r1952 - /branches/lennart/src/modules/module-ladspa-sink.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Wed Oct 24 22:49:12 PDT 2007
Author: tanuk
Date: Thu Oct 25 07:49:11 2007
New Revision: 1952
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1952&root=pulseaudio&view=rev
Log:
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).
Modified:
branches/lennart/src/modules/module-ladspa-sink.c
Modified: branches/lennart/src/modules/module-ladspa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/module-ladspa-sink.c?rev=1952&root=pulseaudio&r1=1951&r2=1952&view=diff
==============================================================================
--- branches/lennart/src/modules/module-ladspa-sink.c (original)
+++ branches/lennart/src/modules/module-ladspa-sink.c Thu Oct 25 07:49:11 2007
@@ -20,6 +20,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
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>
@@ -70,6 +73,10 @@
size_t block_size;
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 @@
} 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,8 +475,14 @@
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);
More information about the pulseaudio-commits
mailing list