spa: bump channels to 128 again

Remove the SPA_AUDIO_MAX_POSITION define and use the
SPA_AUDIO_MAX_CHANNELS again.

Make a compile time define to override the default max channels of 64.

Make sure we compile the SPA library with the default 64 channels. If
you use the SPA library on a spa_audio_info you will get 64 channel
support, like before. If you want more channels, you will need to make
a padded structure or redefine the MAX_CHANNELS before you use the
spa_audio_info structures. You can use the padded structure with the
new functions that take the structure size.

With the extra checks in the parsing code, we avoid making a
valid spa_audio_info with too many channels that don't fit in the
structure. This means that code that receives a spa_audio_info can
assume there is enough padding for all the channels.
This commit is contained in:
Wim Taymans 2025-10-24 08:53:21 +02:00
parent be29ae4ef6
commit 6d74eee874
6 changed files with 15 additions and 20 deletions

View file

@ -1,4 +1,6 @@
#undef SPA_AUDIO_MAX_CHANNELS
#define SPA_API_IMPL SPA_EXPORT
#include <spa/utils/defs.h>
#include <spa/buffer/alloc.h>
@ -165,9 +167,3 @@
#include <spa/utils/string.h>
#include <spa/utils/type.h>
#include <spa/utils/type-info.h>