summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/play-memchunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/play-memchunk.c')
-rw-r--r--src/pulsecore/play-memchunk.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/pulsecore/play-memchunk.c b/src/pulsecore/play-memchunk.c
index 7ac579e9..cde6a9ee 100644
--- a/src/pulsecore/play-memchunk.c
+++ b/src/pulsecore/play-memchunk.c
@@ -82,24 +82,33 @@ static void sink_input_drop(pa_sink_input *i, const pa_memchunk*chunk, size_t le
}
int pa_play_memchunk(
- pa_sink *sink,
- const char *name,
- const pa_sample_spec *ss,
- const pa_channel_map *map,
- const pa_memchunk *chunk,
- pa_cvolume *cvolume) {
+ pa_sink *sink,
+ const char *name,
+ const pa_sample_spec *ss,
+ const pa_channel_map *map,
+ const pa_memchunk *chunk,
+ pa_cvolume *volume) {
pa_sink_input *si;
pa_memchunk *nchunk;
+ pa_sink_input_new_data data;
assert(sink);
assert(ss);
assert(chunk);
- if (cvolume && pa_cvolume_is_muted(cvolume))
+ if (volume && pa_cvolume_is_muted(volume))
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_sample_spec(&data, ss);
+ pa_sink_input_new_data_set_channel_map(&data, map);
+ 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_memchunk(
pa_memblock_ref(chunk->memblock);
- pa_sink_notify(sink);
+ pa_sink_notify(si->sink);
return 0;
}