spa: remove some obsolete functions

The spa_audio_info array now always holds enough positions for all
channels and we don't need to wrap around.
This commit is contained in:
Wim Taymans 2025-10-24 09:35:59 +02:00
parent 6d74eee874
commit 78219471ff
12 changed files with 34 additions and 64 deletions

View file

@ -5038,9 +5038,13 @@ static DBusHandlerResult endpoint_set_configuration(DBusConnection *conn,
spa_log_error(monitor->log, "invalid transport configuration");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
if (info.info.raw.channels > MAX_CHANNELS) {
spa_log_error(monitor->log, "too many channels in transport");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
transport->n_channels = info.info.raw.channels;
spa_format_audio_raw_copy_positions(&info.info.raw,
transport->channels, SPA_N_ELEMENTS(transport->channels));
memcpy(transport->channels, info.info.raw.position,
transport->n_channels * sizeof(uint32_t));
} else {
transport->n_channels = 2;
transport->channels[0] = SPA_AUDIO_CHANNEL_FL;

View file

@ -475,7 +475,10 @@ static void get_channels(struct spa_bt_transport *t, bool a2dp_duplex, uint32_t
return;
}
*n_channels = spa_format_audio_raw_copy_positions(&info.info.raw, channels, max_channels);
*n_channels = info.info.raw.channels;
memcpy(channels, info.info.raw.position,
info.info.raw.channels * sizeof(uint32_t));
}
static const char *get_channel_name(uint32_t channel)