summaryrefslogtreecommitdiff
path: root/src/modules/module-sine.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-08-13 16:19:56 +0000
committerLennart Poettering <lennart@poettering.net>2006-08-13 16:19:56 +0000
commita621d9028548723d13df64df06a4f4538504e7a3 (patch)
treeb488b3488a11516b3c594cc2c805d693a5d6c938 /src/modules/module-sine.c
parentb5cbea940ea70b8ed92fa3be6b742e8a14897337 (diff)
downloadpulseaudio-a621d9028548723d13df64df06a4f4538504e7a3.tar.gz
allow hooking into the process of creating playback streams. To implement this I modified the pa_sink_input_new() signature to take a pa_sink_input_new_data structure instead of direct arguments.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1237 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-sine.c')
-rw-r--r--src/modules/module-sine.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/module-sine.c b/src/modules/module-sine.c
index f4392b9a0..5ceddce08 100644
--- a/src/modules/module-sine.c
+++ b/src/modules/module-sine.c
@@ -109,6 +109,7 @@ int pa__init(pa_core *c, pa_module*m) {
pa_sample_spec ss;
uint32_t frequency;
char t[256];
+ pa_sink_input_new_data data;
if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
pa_log(__FILE__": Failed to parse module arguments");
@@ -142,14 +143,21 @@ int pa__init(pa_core *c, pa_module*m) {
calc_sine(u->memblock->data, u->memblock->length, frequency);
snprintf(t, sizeof(t), "Sine Generator at %u Hz", frequency);
- if (!(u->sink_input = pa_sink_input_new(sink, __FILE__, t, &ss, NULL, NULL, 0, -1)))
+
+ pa_sink_input_new_data_init(&data);
+ data.sink = sink;
+ data.driver = __FILE__;
+ data.name = t;
+ pa_sink_input_new_data_set_sample_spec(&data, &ss);
+ data.module = m;
+
+ if (!(u->sink_input = pa_sink_input_new(c, &data, 0)))
goto fail;
u->sink_input->peek = sink_input_peek;
u->sink_input->drop = sink_input_drop;
u->sink_input->kill = sink_input_kill;
u->sink_input->userdata = u;
- u->sink_input->owner = m;
u->peek_index = 0;