Skip to content

Commit

Permalink
Fix a regression in fluid_player_stop() (#822)
Browse files Browse the repository at this point in the history
fluid_player_stop() should not set the STOPPING state, when the player has already finished. Introduced in 6769237.
  • Loading branch information
derselbst authored Mar 27, 2021
1 parent 3f5394a commit 8413c35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/midi/fluid_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,8 @@ fluid_player_play(fluid_player_t *player)
int
fluid_player_stop(fluid_player_t *player)
{
fluid_atomic_int_set(&player->status, FLUID_PLAYER_STOPPING);
fluid_atomic_int_compare_and_exchange(&player->status, FLUID_PLAYER_READY, FLUID_PLAYER_STOPPING);
fluid_atomic_int_compare_and_exchange(&player->status, FLUID_PLAYER_PLAYING, FLUID_PLAYER_STOPPING);
fluid_player_seek(player, fluid_player_get_current_tick(player));
return FLUID_OK;
}
Expand Down

0 comments on commit 8413c35

Please sign in to comment.