/
/
# What does this implement/fix? Moving a live external source (Spotify Connect, AirPlay Receiver, VBAN, ...) from one player to another took it off the old player before the new player had actually started playing it. If the new player then failed to start, the source ended up on neither player and had to be picked again by hand. The handover is now only completed once the new player's stream is actually requested — the moment the plugin has committed to the new player. Until then the source simply stays where it was. A source that is started but never streamed (renderer never fetches the url) is now cleaned up as well, instead of leaving the player stuck showing a source that never played. **Related issue (if applicable):** - follow-up on #5914 ## Types of changes - [ ] 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` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ### Changes - The old player keeps the source until the new player's stream request claims it - Both stream paths (http url and direct PCM) go through the same claim - A source that is never streamed within 30 seconds is released, so the player goes back to its own queue - Tests for a failed handover, a successful one, and the never-streamed case ## 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. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [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.