diff options
Diffstat (limited to 'src/modules/module-ladspa-sink.c')
-rw-r--r-- | src/modules/module-ladspa-sink.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c index 33562b10..21f4a8f1 100644 --- a/src/modules/module-ladspa-sink.c +++ b/src/modules/module-ladspa-sink.c @@ -27,6 +27,7 @@ #endif #include <pulse/xmalloc.h> +#include <pulse/i18n.h> #include <pulsecore/core-error.h> #include <pulsecore/namereg.h> @@ -45,19 +46,20 @@ #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", @@ -235,7 +238,7 @@ static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) { if (amount > 0) { unsigned c; - pa_memblockq_seek(u->memblockq, - (int64_t) amount, PA_SEEK_RELATIVE); + pa_memblockq_seek(u->memblockq, - (int64_t) amount, PA_SEEK_RELATIVE, TRUE); pa_log_debug("Resetting plugin"); @@ -264,7 +267,7 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) { return; pa_memblockq_set_maxrewind(u->memblockq, nbytes); - pa_sink_set_max_rewind(u->sink, nbytes); + pa_sink_set_max_rewind_within_thread(u->sink, nbytes); } /* Called from I/O thread context */ @@ -277,7 +280,7 @@ static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) { if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; - pa_sink_set_max_request(u->sink, nbytes); + pa_sink_set_max_request_within_thread(u->sink, nbytes); } /* Called from I/O thread context */ @@ -290,7 +293,7 @@ static void sink_input_update_sink_latency_range_cb(pa_sink_input *i) { if (!u->sink || !PA_SINK_IS_LINKED(u->sink->thread_info.state)) return; - pa_sink_update_latency_range(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency); + pa_sink_set_latency_range_within_thread(u->sink, i->sink->thread_info.min_latency, i->sink->thread_info.max_latency); } /* Called from I/O thread context */ @@ -322,7 +325,7 @@ static void sink_input_attach_cb(pa_sink_input *i) { pa_sink_set_rtpoll(u->sink, i->sink->rtpoll); pa_sink_attach_within_thread(u->sink); - pa_sink_update_latency_range(u->sink, u->master->thread_info.min_latency, u->master->thread_info.max_latency); + pa_sink_set_latency_range_within_thread(u->sink, u->master->thread_info.min_latency, u->master->thread_info.max_latency); } /* Called from main context */ @@ -705,7 +708,13 @@ 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); - u->sink = pa_sink_new(m->core, &sink_data, PA_SINK_LATENCY); + 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); if (!u->sink) { |