Skip to content

Commit

Permalink
Fix: Clear track_handles when SetTrack heard (#270)
Browse files Browse the repository at this point in the history
Clear `track_handles` when `SetTrack` heard, to prevent an issue where
indices of `tracks` become desynced with those of `track_handles`.

Closes #232.
  • Loading branch information
JellyWX authored Dec 4, 2024
1 parent 552eb7a commit 900f973
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/driver/tasks/mixer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ impl Mixer {
MixerMessage::AddTrack(t) => self.add_track(t),
MixerMessage::SetTrack(t) => {
self.tracks.clear();
self.track_handles.clear();

let mut out = self.fire_event(EventMessage::RemoveAllTracks);

Expand Down

0 comments on commit 900f973

Please sign in to comment.