Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

This forum is about all development around libVLC.
Jona
Blank Cone
Blank Cone
Posts: 13
Joined: 11 Jun 2024 01:04
VLC version: 4
Operating System: Linux / Windows

Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Postby Jona » 03 Dec 2024 04:24

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).

mfkl
Developer
Developer
Posts: 746
Joined: 13 Jun 2017 10:41

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Postby mfkl » 03 Dec 2024 10:24

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.
https://mfkl.github.io

Rémi Denis-Courmont
Developer
Developer
Posts: 15272
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Postby Rémi Denis-Courmont » 03 Dec 2024 12:54

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jona
Blank Cone
Blank Cone
Posts: 13
Joined: 11 Jun 2024 01:04
VLC version: 4
Operating System: Linux / Windows

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Postby Jona » 03 Dec 2024 13:27

I see, thanks.

Jona
Blank Cone
Blank Cone
Posts: 13
Joined: 11 Jun 2024 01:04
VLC version: 4
Operating System: Linux / Windows

Re: Feature request: Choose buffersize for libvlc_audio_set_format_callbacks

Postby Jona » 03 Dec 2024 21:10

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


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 8 guests