fix(server): add hint header for segment after init.mp4 (#28867)

* add hint header for segment after init.mp4

* use zod

* actually validate

* update openapi

* linting
This commit is contained in:
Mert
2026-06-10 19:18:36 -04:00
committed by GitHub
parent 74878628c8
commit aa126e377c
9 changed files with 115 additions and 17 deletions
+13 -3
View File
@@ -30,6 +30,7 @@ type Session = {
ownerId: string;
paused: boolean;
process: ChildProcess | null;
starting: boolean;
startSegment: number | null;
variantIndex: number | null;
};
@@ -75,6 +76,7 @@ export class TranscodingService extends BaseService {
ownerId,
paused: false,
process: null,
starting: false,
startSegment: null,
variantIndex: null,
});
@@ -145,11 +147,19 @@ export class TranscodingService extends BaseService {
} else if (session.process) {
this.resumeTranscode(session);
return;
} else if (session.starting) {
this.logger.debug(`Session ${sessionId} is already starting a transcode, skipping duplicate start request`);
return;
}
const process = await this.startTranscode(session, variantIndex, segmentIndex);
if (process) {
session.process = process;
session.starting = true;
try {
const process = await this.startTranscode(session, variantIndex, segmentIndex);
if (process) {
session.process = process;
}
} finally {
session.starting = false;
}
}