spa: alsa: change index type

The `card` structure uses `uint32_t` for its index member,
on the other hand, the `state` structure uses `int`. No code
depends on it being `int`, therefore change it to `uint32_t`
for consistency.
This commit is contained in:
Barnabás Pőcze 2021-12-20 19:20:38 +01:00
parent 3c66d46007
commit ee0963b68e
2 changed files with 3 additions and 3 deletions

View file

@ -402,7 +402,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
}
if (state->clock_name[0] == '\0')
snprintf(state->clock_name, sizeof(state->clock_name),
"api.alsa.%d", state->card_index);
"api.alsa.%u", state->card_index);
if (state->stream == SND_PCM_STREAM_PLAYBACK) {
state->is_iec958 = spa_strstartswith(state->props.device, "iec958");
@ -412,7 +412,7 @@ int spa_alsa_init(struct state *state, const struct spa_dict *info)
state->card = ensure_card(state->card_index, state->open_ucm);
if (state->card == NULL) {
spa_log_error(state->log, "can't create card %d", state->card_index);
spa_log_error(state->log, "can't create card %u", state->card_index);
return -errno;
}
return 0;

View file

@ -109,7 +109,7 @@ struct state {
struct spa_system *data_system;
struct spa_loop *data_loop;
int card_index;
uint32_t card_index;
struct card *card;
snd_pcm_stream_t stream;
snd_output_t *output;