Page 1 of 1

Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Posted: 03 Dec 2024 04:24
by Jona
Not sure, if I ask to much, but it would be really great to choose the buffersize for

Code: Select all

libvlc_audio_set_format_callbacks
.
Currently it depends on the codec. But for integrating libvlc into Open Frameworks I need a buffersize with a power of two (128, 256, 512, 1024, etc.) for passing it to the sound device.
Currently .mkv with .aac audio is the only format (that I found so far) that has an audio buffersize of 1024 and works perfectly well, all other codecs audio has artifacts because the buffersize is not a power of two (1152 (.mp3) or 2205(.wav) for example).

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Posted: 03 Dec 2024 10:24
by mfkl
Better place for feature request is https://code.videolan.org/videolan/vlc/-/issues. I don't know if it would a good idea for libvlc.

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Posted: 03 Dec 2024 12:54
by RĂ©mi Denis-Courmont
LibVLC gives samples when they are available. if you need to slice buffers in whatever size, that's up to your callback implementation. That's more or less how every VLC audio output module works and every app that uses the API to output to a local audio device also.

It makes zero sense to do that in LibVLC, TBH.

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Posted: 03 Dec 2024 13:27
by Jona
I see, thanks.

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Posted: 03 Dec 2024 21:10
by Jona
It does work now. Here my code, if anybody wants to see (sorry for asking to fast for an alternative solution): https://github.com/Jonathhhan/ofxVlcPla ... Player.cpp