summaryrefslogtreecommitdiff
path: root/src/modules/module-pipe-source.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/module-pipe-source.c')
-rw-r--r--src/modules/module-pipe-source.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c
index 3d40fdf3..e5609fb5 100644
--- a/src/modules/module-pipe-source.c
+++ b/src/modules/module-pipe-source.c
@@ -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
};
@@ -127,7 +129,6 @@ static void thread_func(void *userdata) {
pa_log_debug("Thread starting up");
pa_thread_mq_install(&u->thread_mq);
- pa_rtpoll_install(u->rtpoll);
for (;;) {
int ret;
@@ -264,6 +265,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);
@@ -277,6 +284,7 @@ int pa__init(pa_module*m) {
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
+ pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(PIPE_BUF, &u->source->sample_spec));
u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);