mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-15 22:05:28 -05:00
treewide: remove some obsolete channel checks
The spa_audio_info can not be parsed with too many channels so there is always enough space for the positions.
This commit is contained in:
parent
78219471ff
commit
aa0272f6f3
8 changed files with 50 additions and 64 deletions
|
|
@ -215,16 +215,16 @@ static const struct spa_audio_layout_info layouts[] = {
|
|||
{ SPA_AUDIO_LAYOUT_7_1 },
|
||||
};
|
||||
|
||||
static void default_layout(uint32_t channels, uint32_t *position, uint32_t max_position)
|
||||
static void default_layout(uint32_t channels, uint32_t *position)
|
||||
{
|
||||
SPA_FOR_EACH_ELEMENT_VAR(layouts, l) {
|
||||
if (l->n_channels == channels) {
|
||||
for (uint32_t i = 0; i < l->n_channels && i < max_position; i++)
|
||||
for (uint32_t i = 0; i < l->n_channels; i++)
|
||||
position[i] = l->position[i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (uint32_t i = 0; i < channels && i < max_position; i++)
|
||||
for (uint32_t i = 0; i < channels; i++)
|
||||
position[i] = SPA_AUDIO_CHANNEL_AUX0 + i;
|
||||
}
|
||||
|
||||
|
|
@ -278,10 +278,10 @@ struct vban_stream *vban_stream_new(struct pw_core *core,
|
|||
pw_log_error("can't parse format: %s", spa_strerror(res));
|
||||
goto out;
|
||||
}
|
||||
if (SPA_FLAG_IS_SET(impl->info.info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED))
|
||||
default_layout(impl->info.info.raw.channels,
|
||||
impl->info.info.raw.position,
|
||||
SPA_N_ELEMENTS(impl->info.info.raw.position));
|
||||
if (SPA_FLAG_IS_SET(impl->info.info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED)) {
|
||||
default_layout(impl->info.info.raw.channels, impl->info.info.raw.position);
|
||||
SPA_FLAG_CLEAR(impl->info.info.raw.flags, SPA_AUDIO_FLAG_UNPOSITIONED);
|
||||
}
|
||||
impl->stream_info = impl->info;
|
||||
impl->format_info = find_audio_format_info(&impl->info);
|
||||
if (impl->format_info == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue