output/jack: pass float* to WriteSamples()
This commit is contained in:
parent
cec2a837cf
commit
b83a1d79b7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user