summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/play-memblockq.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/pulsecore/play-memblockq.c
parentb5cbea940ea70b8ed92fa3be6b742e8a14897337 (diff)
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/pulsecore/play-memblockq.c')
-rw-r--r--src/pulsecore/play-memblockq.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/pulsecore/play-memblockq.c b/src/pulsecore/play-memblockq.c
index 7b796a8d..f459142a 100644
--- a/src/pulsecore/play-memblockq.c
+++ b/src/pulsecore/play-memblockq.c
@@ -79,14 +79,15 @@ static void sink_input_drop(pa_sink_input *i, const pa_memchunk*chunk, size_t le
}
int pa_play_memblockq(
- pa_sink *sink,
- const char *name,
- const pa_sample_spec *ss,
- const pa_channel_map *map,
- pa_memblockq *q,
- pa_cvolume *cvolume) {
+ pa_sink *sink,
+ const char *name,
+ const pa_sample_spec *ss,
+ const pa_channel_map *map,
+ pa_memblockq *q,
+ pa_cvolume *volume) {
pa_sink_input *si;
+ pa_sink_input_new_data data;
assert(sink);
assert(ss);
@@ -97,12 +98,20 @@ int pa_play_memblockq(
return 0;
}
- if (cvolume && pa_cvolume_is_muted(cvolume)) {
+ if (volume && pa_cvolume_is_muted(volume)) {
pa_memblockq_free(q);
return 0;
}
- if (!(si = pa_sink_input_new(sink, name, __FILE__, ss, map, cvolume, 0, PA_RESAMPLER_INVALID)))
+ pa_sink_input_new_data_init(&data);
+ data.sink = sink;
+ data.name = name;
+ data.driver = __FILE__;
+ pa_sink_input_new_data_set_channel_map(&data, map);
+ pa_sink_input_new_data_set_sample_spec(&data, ss);
+ pa_sink_input_new_data_set_volume(&data, volume);
+
+ if (!(si = pa_sink_input_new(sink->core, &data, 0)))
return -1;
si->peek = sink_input_peek;
@@ -111,7 +120,7 @@ int pa_play_memblockq(
si->userdata = q;
- pa_sink_notify(sink);
+ pa_sink_notify(si->sink);
return 0;
}