Skip to content

Fixed Player::skip_one not updating player's length immediately.#842

Open
nieboczek wants to merge 3 commits intoRustAudio:masterfrom
nieboczek:master
Open

Fixed Player::skip_one not updating player's length immediately.#842
nieboczek wants to merge 3 commits intoRustAudio:masterfrom
nieboczek:master

Conversation

@nieboczek
Copy link

Fixes #497.
Needed to add Done::should_decrement to achieve this fix.

Instead of updating sound_count in the periodic access source, I made it update directly in the skip_one function (clear affected too).
When controls.to_clear > 0 in periodic access, it will use Done::should_decrement to temporarily disable decrementing sound_count.

Also added Done::should_decrease to achieve that.
@nieboczek
Copy link
Author

nieboczek commented Feb 6, 2026

Something very bad seems to be happening with the Player, adding a simple assert_eq hangs the test on Player::clear:

        // ...
        assert_eq!(player.len(), 1);

        assert_eq!(source.next(), Some(1.0));

        player.clear();
        // ...

Could I get some help on this? Fixed.

@nieboczek
Copy link
Author

I've hopefully fixed that. Also saw a queue issue where it wouldn't play the first audio appended in my own app with the version from the PR, but that is working correctly after my latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sink::skip_one doesn't modify the sink's length accordingly

1 participant