]> code.delx.au - pulseaudio/blobdiff - src/modules/module-pipe-sink.c
modules: add {sink|source|card}_properties argument to all modules
[pulseaudio] / src / modules / module-pipe-sink.c
index 304d01c7518b9686226eceb893842eb36791511c..5b0f64142ca2699118a490cdf4e1022e02e2283b 100644 (file)
@@ -54,10 +54,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "sink_name=<name for the sink> "
+        "sink_properties=<properties for the sink> "
         "file=<path of the FIFO> "
         "format=<sample format> "
-        "channels=<number of channels> "
         "rate=<sample rate>"
+        "channels=<number of channels> "
         "channel_map=<channel map>");
 
 #define DEFAULT_FILE_NAME "fifo_output"
@@ -83,11 +84,12 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "sink_name",
+    "sink_properties",
     "file",
-    "rate",
     "format",
+    "rate",
     "channels",
-    "sink_name",
     "channel_map",
     NULL
 };
@@ -279,6 +281,12 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_sink_new_data_set_channel_map(&data, &map);
 
+    if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_sink_new_data_done(&data);
+        goto fail;
+    }
+
     u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY);
     pa_sink_new_data_done(&data);