fix(producer): clamp embedded video/audio windows to the scene (#3332)

Browser probe end reflects full source duration, not the scene slot.
Never extend a compile-time end — only fill missing or shrink — so long
recordings sliced across short scenes don't inflate extraction windows
and time out black on Cloud Run (ARC-13403).
This commit is contained in:
Val
2026-08-18 17:45:12 -04:00
committed by GitHub
parent c1c70f44bd
commit b31dde35b1
@@ -508,11 +508,9 @@ export async function runProbeStage(input: ProbeStageInput): Promise<ProbeStageR
el.start,
resolveBrowserMediaEnd(el.start, el.end, el.duration),
);
if (
projectedEnd > 0 &&
(existing.end <= 0 || Math.abs(existing.end - projectedEnd) > BROWSER_MEDIA_EPSILON)
) {
existing.end = projectedEnd;
if (projectedEnd > 0) {
existing.end =
existing.end <= 0 ? projectedEnd : Math.min(existing.end, projectedEnd);
}
if (
el.mediaStart > 0 &&
@@ -554,11 +552,9 @@ export async function runProbeStage(input: ProbeStageInput): Promise<ProbeStageR
el.start,
resolveBrowserMediaEnd(el.start, el.end, el.duration),
);
if (
projectedEnd > 0 &&
(existing.end <= 0 || Math.abs(existing.end - projectedEnd) > BROWSER_MEDIA_EPSILON)
) {
existing.end = projectedEnd;
if (projectedEnd > 0) {
existing.end =
existing.end <= 0 ? projectedEnd : Math.min(existing.end, projectedEnd);
}
if (
el.mediaStart > 0 &&