fix: move prev_state update after MIDI clock handler to fix race condition

Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-07 22:41:47 +00:00
parent 829010a5d0
commit 3bb5936d02
2 changed files with 3 additions and 1 deletions

View File

@@ -51,7 +51,6 @@ static int process(jack_nframes_t nframes, void *arg)
}
playback_pos = 0; /* restart from beginning */
}
prev_state = state;
}
/* ----- handle MIDI control port (state transitions) ----- */
@@ -160,6 +159,9 @@ static int process(jack_nframes_t nframes, void *arg)
}
}
/* update prev_state after all state changes */
prev_state = atomic_load(&current_state);
return 0;
}