Fix a regression in fluid_player_stop() (#822)

fluid_player_stop() should not set the STOPPING state, when the player has already finished. Introduced in 676923757c.
This commit is contained in:
Tom M 2021-03-27 18:35:00 +01:00 committed by GitHub
parent 3f5394a15d
commit 8413c35aca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}