fix: only create one instance of ChildProcessHelper per-FfmpegInfo

This commit is contained in:
Christian Benincasa
2026-04-15 07:46:13 -04:00
parent 30ff2f88fc
commit cdf0eb99e8

View File

@@ -71,6 +71,8 @@ export class FfmpegInfo {
return format(`${path}_${CacheKeys[command]}`, ...args);
}
private childProcessHelper = new ChildProcessHelper();
constructor(
@inject(KEYS.FFmpegPath) private ffmpegPath: string,
@inject(KEYS.FFprobePath) private ffprobePath: string,
@@ -353,7 +355,7 @@ export class FfmpegInfo {
args: string[],
opts?: GetStdoutOptions,
): Promise<string> {
return new ChildProcessHelper().getStdout(executable, args, opts);
return this.childProcessHelper.getStdout(executable, args, opts);
}
private cacheKey(key: keyof typeof CacheKeys): string {