/
/
# What does this implement/fix? Fixes two issues in the MilkDrop visualizer tap, flagged by Copilot on the post-merge review of #5864: **Playback speed.** The tap mapped media time to the relay clock at a fixed 1x, but queues advance `corrected_elapsed_time` at `playback_speed` media-seconds per wall second (audiobooks/podcasts, 0.5x to 3x via atempo). At 2x the drift crossed the 3s resync threshold every ~3 seconds, fanning `stream/clear` to every viewer on that cadence, with frame and beat stamps progressively off in between. The cursor now carries the queue's speed: the anchor, `playhead()`, waveform frame stamps and beat stamps all map through it, and a speed change re-anchors. Chunk indexing needed no changes: the analysis buffer stores raw pre-atempo PCM, so chunk N is still media second N. **Stale beats.** `Tap.reset()` did not cancel an in-flight beat hydration, so a track stopped during the retry window (up to ~90s) could still land beats for the dead timeline and replay them to newly attaching viewers. The reset now cancels the task; `_align` reschedules right after, so resume behavior is unchanged apart from the hydration restarting (a DB read, and the `beats_analysis` cache still short-circuits it). At 1x every changed expression reduces exactly to the previous arithmetic, so music playback is untouched. Not present on `stable`, so no backport label. **Related issue (if applicable):** - n/a (found in post-merge review of #5864) ## Types of changes - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. (n/a) - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. (n/a) - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate. (n/a)