]> code.delx.au - pulseaudio/blobdiff - src/modules/module-pipe-source.c
modules: add {sink|source|card}_properties argument to all modules
[pulseaudio] / src / modules / module-pipe-source.c
index 6ed4fbfe281c7a35ec62187731c6f1fb324c43e5..61c9fc0eb61e5b8f5d1162d858ae57397518879e 100644 (file)
@@ -54,10 +54,11 @@ PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(FALSE);
 PA_MODULE_USAGE(
         "source_name=<name for the source> "
+        "source_properties=<properties for the source> "
         "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 "/tmp/music.input"
@@ -81,11 +82,12 @@ struct userdata {
 };
 
 static const char* const valid_modargs[] = {
+    "source_name",
+    "source_properties",
     "file",
+    "format",
     "rate",
     "channels",
-    "format",
-    "source_name",
     "channel_map",
     NULL
 };
@@ -264,6 +266,12 @@ int pa__init(pa_module*m) {
     pa_source_new_data_set_sample_spec(&data, &ss);
     pa_source_new_data_set_channel_map(&data, &map);
 
+    if (pa_modargs_get_proplist(ma, "source_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
+        pa_log("Invalid properties");
+        pa_source_new_data_done(&data);
+        goto fail;
+    }
+
     u->source = pa_source_new(m->core, &data, PA_SOURCE_LATENCY);
     pa_source_new_data_done(&data);