mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
Don't use SPA_AUDIO_MAX_CHANNELS directly
Make a MAX_CHANNELS define and use that one in code. This makes it easier to change the constant later.
This commit is contained in:
parent
eb096bfb62
commit
13b8c23767
30 changed files with 136 additions and 108 deletions
|
|
@ -115,6 +115,7 @@
|
|||
PW_LOG_TOPIC_STATIC(mod_topic, "mod." NAME);
|
||||
#define PW_LOG_TOPIC_DEFAULT mod_topic
|
||||
|
||||
#define MAX_CHANNELS SPA_AUDIO_MAX_CHANNELS
|
||||
#define MAX_PORTS 128
|
||||
|
||||
#define DEFAULT_CLIENT_NAME "PipeWire"
|
||||
|
|
@ -157,7 +158,7 @@ struct port {
|
|||
struct volume {
|
||||
bool mute;
|
||||
uint32_t n_volumes;
|
||||
float volumes[SPA_AUDIO_MAX_CHANNELS];
|
||||
float volumes[MAX_CHANNELS];
|
||||
};
|
||||
|
||||
struct stream {
|
||||
|
|
@ -624,7 +625,7 @@ static void parse_props(struct stream *s, const struct spa_pod *param)
|
|||
case SPA_PROP_channelVolumes:
|
||||
{
|
||||
uint32_t n;
|
||||
float vols[SPA_AUDIO_MAX_CHANNELS];
|
||||
float vols[MAX_CHANNELS];
|
||||
if ((n = spa_pod_copy_array(&prop->value, SPA_TYPE_Float,
|
||||
vols, SPA_AUDIO_MAX_CHANNELS)) > 0) {
|
||||
s->volume.n_volumes = n;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue