Skip to content

Mixer mishandles sources that are added out of phase #854

@will3942

Description

@will3942

If a source is added whilst the mixer is outputting on a non-zero channel the source will be added to the still_pending Vec but there is no process for dequeuing from this Vec and adding to the current_sources Vec.

We run a custom mixer so haven't ran into this issue ourselves but when migrating the performance improvements from the upstream Mixer in 0.22 we noticed this oddity.

The fix should be straightforward for start_pending_sources to check still_pending and the phase alignment on the next iteration but it would be worth adding a regression test here too to catch it in the future.

Code snippet: https://github.com/RustAudio/rodio/blob/master/src/mixer.rs#L145-L157

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions