]> code.delx.au - pulseaudio/blobdiff - src/modules/module-ladspa-sink.c
tunnel: don't assert on misaligned reads, closes #597 and rhbz #496310
[pulseaudio] / src / modules / module-ladspa-sink.c
index 44052c9c47f9f89c193beb5f9439c643477fb57a..21f4a8f1ecb2f7e1924158e786b4e4ad5de1b46a 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <pulse/xmalloc.h>
+#include <pulse/i18n.h>
 
 #include <pulsecore/core-error.h>
 #include <pulsecore/namereg.h>
 #include "ladspa.h"
 
 PA_MODULE_AUTHOR("Lennart Poettering");
-PA_MODULE_DESCRIPTION("Virtual LADSPA sink");
+PA_MODULE_DESCRIPTION(_("Virtual LADSPA sink"));
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
-        "sink_name=<name for the sink> "
-        "master=<name of sink to remap> "
-        "format=<sample format> "
-        "channels=<number of channels> "
-        "rate=<sample rate> "
-        "channel_map=<channel map> "
-        "plugin=<ladspa plugin name> "
-        "label=<ladspa plugin label> "
-        "control=<comma seperated list of input control values>");
+        _("sink_name=<name for the sink> "
+          "sink_properties=<properties for the sink> "
+          "master=<name of sink to filter> "
+          "format=<sample format> "
+          "rate=<sample rate> "
+          "channels=<number of channels> "
+          "channel_map=<channel map> "
+          "plugin=<ladspa plugin name> "
+          "label=<ladspa plugin label> "
+          "control=<comma seperated list of input control values>"));
 
 #define MEMBLOCKQ_MAXLENGTH (16*1024*1024)
 
@@ -85,10 +87,11 @@ struct userdata {
 
 static const char* const valid_modargs[] = {
     "sink_name",
+    "sink_properties",
     "master",
     "format",
-    "channels",
     "rate",
+    "channels",
     "channel_map",
     "plugin",
     "label",
@@ -705,6 +708,12 @@ int pa__init(pa_module*m) {
     pa_proplist_sets(sink_data.proplist, "device.ladspa.copyright", d->Copyright);
     pa_proplist_setf(sink_data.proplist, "device.ladspa.unique_id", "%lu", (unsigned long) d->UniqueID);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", sink_data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&sink_data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY);
     pa_sink_new_data_done(&sink_data);