[LAD] jack ringbuffer usage

From: Raphaël BOLLEN <raphael.bollen@email-addr-hidden>
Date: Mon Apr 08 2013 - 14:45:32 EEST

Hi,

I'm trying to use jack's ringbuffer like this:

- initialization:

jack_ringbuffer_t * ringBuf = jack_ringbuffer_create(sizeof(jack_default_audio_sample_t) * (1<<16));
memset (ringBuf->buf, 0, ringBuf->size) ;

- jack process callback:

jack_default_audio_sample_t buf[numChannels];
size_t read_cnt = 0;
for (_frameCounter=0; _frameCounter < nFrames; _frameCounter++) {
     read_cnt = jack_ringbuffer_read(ringBuf, (void*)buf, sample_size * numChannels);
                                              ^^^^^^^^^ error
}

but g++ won't compile the code and report this

error: invalid conversion from 'void*' to 'char*' [-fpermissive]
/usr/local/include/jack/ringbuffer.h:136: error: initializing argument 2 of 'size_t
jack_ringbuffer_read(jack_ringbuffer_t*, char*, size_t)' [-fpermissive]

passing -fpermissive gets the program running but is it the right way to do it?

Thanks

--
Raphaël.
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Apr 8 16:15:05 2013

This archive was generated by hypermail 2.1.8 : Mon Apr 08 2013 - 16:15:05 EEST