fix(player): a stale session answer can no longer stop the playback that won

- The engine tracks the request out per item: A, then B, then back to A sent a second request
  for A beside the one still out.
- A hardware transcode superseded during its fallback answered with the NEWER session; the losing
  request's player then stopped it as stale. It now answers with its own (dead) session.
- A replaced hls.js instance's late manifest no longer marks the player ready or plays the
  outgoing media.
- A pause given after the answer stands: the manifest and the first canplay read the live intent.
- The debounced A/V-offset restart is dropped on an item change instead of restarting the
  previous item under the next one's title.
This commit is contained in:
2026-10-07 23:16:25 +02:00
parent d25a132495
commit 0a35f2a3b1
6 changed files with 131 additions and 15 deletions
+10
View File
@@ -723,6 +723,16 @@ export function usePlexTracks(opts: {
},
[patchPrefs, restartSession, aoffRef, playhead],
);
// A restart still waiting belongs to the item it was asked on: fired after a move to the next one,
// it restarted the PREVIOUS item, whose stream then played under the new title. The new item's
// session reads the offset itself (`aoffRef`), so nothing is lost by dropping it.
useEffect(
() => () => {
if (aoffTimer.current) window.clearTimeout(aoffTimer.current);
aoffTimer.current = null;
},
[id],
);
// --- is the selected track actually extractable yet? -------------------------------------------
// Pulling one subtitle track out of a big MKV means ffmpeg streams the whole container: measured on