aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-24 23:02:19 +0100
committerMax Kellermann <max@duempel.org>2014-12-24 23:02:19 +0100
commitb83a1d79b78265ff197f2677790eb34eb3bf7aae (patch)
treeb635042ce7802362fdf0bdfbdd4474265746228a /src/output
parentcec2a837cf7c3f3e2bf5e53c9c88992cb0d0e5e7 (diff)
downloadmpd-b83a1d79b78265ff197f2677790eb34eb3bf7aae.tar.gz
mpd-b83a1d79b78265ff197f2677790eb34eb3bf7aae.tar.xz
mpd-b83a1d79b78265ff197f2677790eb34eb3bf7aae.zip
output/jack: pass float* to WriteSamples()
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/JackOutputPlugin.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/output/plugins/JackOutputPlugin.cxx b/src/output/plugins/JackOutputPlugin.cxx
index e104c3cb4..2872e27aa 100644
--- a/src/output/plugins/JackOutputPlugin.cxx
+++ b/src/output/plugins/JackOutputPlugin.cxx
@@ -114,7 +114,7 @@ struct JackOutput {
/**
* @return the number of frames that were written
*/
- size_t WriteSamples(const void *src, size_t n_frames);
+ size_t WriteSamples(const float *src, size_t n_frames);
size_t Play(const void *chunk, size_t size, Error &error);
};
@@ -641,12 +641,10 @@ mpd_jack_delay(AudioOutput *ao)
}
inline size_t
-JackOutput::WriteSamples(const void *_src, size_t n_frames)
+JackOutput::WriteSamples(const float *src, size_t n_frames)
{
const size_t result = n_frames;
- const float *src = (const float *)_src;
-
while (n_frames-- > 0) {
for (unsigned i = 0; i < audio_format.channels; ++i, ++src) {
jack_ringbuffer_write(ringbuffer[i],
@@ -697,7 +695,7 @@ JackOutput::Play(const void *chunk, size_t size, Error &error)
if (space < size)
size = space;
- return WriteSamples(chunk, size) * frame_size;
+ return WriteSamples((const float *)chunk, size) * frame_size;
}
static size_t