You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace Jellycompat upstream when the media source changes #750
The Jellyfin-compatible playback-session reuse path primarily matches the selected play method. When a title has multiple media files, selecting a different media source with the same method can leave the prior upstream session eligible for reuse. That can make a later reconstruction start from the old file even though the requested media source changed.
The stereo-downmix work in #748 validates media-file identity in the persisted recipe and fails closed when it does not match, but the underlying same-method reuse rule applies to playback more broadly.
Acceptance criteria
Include media-file identity in every upstream-session reuse and compare-and-swap decision.
Close and recreate the upstream when the requested media source differs, even if the play method is unchanged.
Preserve the identity through reconstruction and remote-node adoption.
Add coverage for direct play, remux, HLS transcode, and concurrent selection of two versions of one item.
Context
Follow-up to #748 and the broader Playback V3 work in #579.
Reproduced on origin/main at bd40bd9 with a local build and a synthetic movie in two versions (1080p, 720p). Under one play, a direct play of the 720p version after the 1080p one streamed the 720p file while the session, Now Playing and the playback log stayed on the 1080p file. The same switch over HLS answered 503 ("transcode recipe does not match the selected media source") and ended the play.
Cause: ensureUpstreamPlayback reused the play's upstream session whenever the play method matched, without checking which file it streamed.
Fix in #4572: a request for another version now replaces the upstream session, and only stream-opening requests can do that; child playlists, segments and report revives can't switch a play back. Checked on a local build of the fix with the same steps: the 720p request gets a new session bound to the 720p file, HLS serves 1280x720 segments, and a late 1080p child playlist is refused while the 720p stream keeps playing. Tests cover the switch for direct play, remux and HLS, concurrent starts of two versions, and late playlist and revive requests. Not covered: a switch handled on another API replica still can't stop that replica's copy of the old session until stale cleanup, the same as for play-method switches today.
AI disclosure: reproduced and fixed by Claude Code (claude-opus-5-5) at the maintainer's direction.
Activity
Rhainland commentedon Nov 19, 2026
Reproduced on
origin/mainat bd40bd9 with a local build and a synthetic movie in two versions (1080p, 720p). Under one play, a direct play of the 720p version after the 1080p one streamed the 720p file while the session, Now Playing and the playback log stayed on the 1080p file. The same switch over HLS answered 503 ("transcode recipe does not match the selected media source") and ended the play.Cause:
ensureUpstreamPlaybackreused the play's upstream session whenever the play method matched, without checking which file it streamed.Fix in #4572: a request for another version now replaces the upstream session, and only stream-opening requests can do that; child playlists, segments and report revives can't switch a play back. Checked on a local build of the fix with the same steps: the 720p request gets a new session bound to the 720p file, HLS serves 1280x720 segments, and a late 1080p child playlist is refused while the 720p stream keeps playing. Tests cover the switch for direct play, remux and HLS, concurrent starts of two versions, and late playlist and revive requests. Not covered: a switch handled on another API replica still can't stop that replica's copy of the old session until stale cleanup, the same as for play-method switches today.
AI disclosure: reproduced and fixed by Claude Code (claude-opus-5-5) at the maintainer's direction.