mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-17 22:05:38 -05:00
spa: avoid using SPA_AUDIO_MAX_CHANNELS
Use SPA_N_ELEMENTS instead of the array we try to handle.
This commit is contained in:
parent
818d1435ce
commit
dbc5c81e4a
7 changed files with 22 additions and 16 deletions
|
|
@ -1228,8 +1228,9 @@ static int probe_ffado_device(struct impl *impl)
|
|||
impl->source.ports[i] = port;
|
||||
}
|
||||
if (impl->source.info.channels != n_channels) {
|
||||
uint32_t n_pos = SPA_MIN(n_channels, SPA_N_ELEMENTS(impl->source.info.position));
|
||||
impl->source.info.channels = n_channels;
|
||||
for (i = 0; i < SPA_MIN(impl->source.info.channels, SPA_AUDIO_MAX_CHANNELS); i++)
|
||||
for (i = 0; i < n_pos; i++)
|
||||
impl->source.info.position[i] = SPA_AUDIO_CHANNEL_AUX0 + i;
|
||||
}
|
||||
|
||||
|
|
@ -1254,8 +1255,9 @@ static int probe_ffado_device(struct impl *impl)
|
|||
impl->sink.ports[i] = port;
|
||||
}
|
||||
if (impl->sink.info.channels != n_channels) {
|
||||
uint32_t n_pos = SPA_MIN(n_channels, SPA_N_ELEMENTS(impl->sink.info.position));
|
||||
impl->sink.info.channels = n_channels;
|
||||
for (i = 0; i < SPA_MIN(impl->sink.info.channels, SPA_AUDIO_MAX_CHANNELS); i++)
|
||||
for (i = 0; i < n_pos; i++)
|
||||
impl->sink.info.position[i] = SPA_AUDIO_CHANNEL_AUX0 + i;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue