alsa-seq: add the source only on success

Otherwise if we have an error with the timerfd, we have the source fd
added and we close the device.
This commit is contained in:
Wim Taymans 2025-04-24 13:21:07 +02:00
parent 41665e6bb8
commit 7e4dd9524f

View file

@ -404,7 +404,6 @@ int spa_alsa_seq_open(struct seq_state *state)
state->sys.source.func = alsa_seq_on_sys;
state->sys.source.data = state;
spa_loop_add_source(state->main_loop, &state->sys.source);
/* increase event queue timer resolution */
snd_seq_queue_timer_alloca(&timer);
@ -449,6 +448,8 @@ int spa_alsa_seq_open(struct seq_state *state)
state->timerfd = res;
spa_loop_add_source(state->main_loop, &state->sys.source);
state->opened = true;
return 0;