mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-16 13:55:51 -07:00
fix(overlay): defer autoplay release for untokenized startup priming
- Autoplay-ready gate now ignores untokenized subtitle payloads while tokenization warmup is pending, so playback doesn't resume before the first tokenized cue - Wire isTokenizationReady dep through main.ts and update gate/wiring tests accordingly - Drop stale release/release-notes.md, add changelog entry under changes/
This commit is contained in:
@@ -26,6 +26,7 @@ export type AutoplayReadyGateDeps = {
|
||||
getPlaybackPaused: () => boolean | null;
|
||||
getMpvClient: () => MpvClientLike | null;
|
||||
signalPluginAutoplayReady: () => void;
|
||||
isTokenizationReady?: () => boolean;
|
||||
requestOverlayPointerRecovery?: () => void;
|
||||
onAutoplayReadyReleased?: (signal: AutoplayReadySignal) => void;
|
||||
isSignalTargetReady?: (signal: AutoplayReadySignal) => boolean;
|
||||
@@ -217,6 +218,15 @@ export function createAutoplayReadyGate(deps: AutoplayReadyGateDeps) {
|
||||
if (!payload.text.trim()) {
|
||||
return;
|
||||
}
|
||||
// Untokenized payloads (startup subtitle priming, tokenizer fallbacks) must
|
||||
// not release the startup pause gate while tokenization warmup is pending —
|
||||
// the tokenized delivery or the post-warmup release signals readiness later.
|
||||
if (payload.tokens === null && deps.isTokenizationReady && !deps.isTokenizationReady()) {
|
||||
deps.logDebug(
|
||||
'[autoplay-ready] ignored untokenized signal while tokenization warmup is pending',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
maybeReleaseAutoplayReadySignal({
|
||||
mediaPath: getSignalMediaPath(),
|
||||
|
||||
Reference in New Issue
Block a user