fix(TransformerGraph): Explicitly include input args for readable input cases instead of just for string input cases (#9793)

Explicitly add input args for readable input cases instead of just for string input cases.
Change also ensures that constant arrays are passed by value instead of by reference, preventing them from accidentally being modified.

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
White Wolf
2023-08-23 10:10:22 -06:00
committed by GitHub
parent f6c7c14c9e
commit 788888ab9a

View File

@@ -151,7 +151,7 @@ const FFMPEG_PCM_EDGE: Omit<Edge, 'from'> = {
cost: 2,
transformer: (input) =>
new prism.FFmpeg({
args: typeof input === 'string' ? ['-i', input, ...FFMPEG_PCM_ARGUMENTS] : FFMPEG_PCM_ARGUMENTS,
args: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_PCM_ARGUMENTS],
}),
};
@@ -182,7 +182,7 @@ if (canEnableFFmpegOptimizations()) {
cost: 2,
transformer: (input) =>
new prism.FFmpeg({
args: typeof input === 'string' ? ['-i', input, ...FFMPEG_OPUS_ARGUMENTS] : FFMPEG_OPUS_ARGUMENTS,
args: ['-i', typeof input === 'string' ? input : '-', ...FFMPEG_OPUS_ARGUMENTS],
}),
};
getNode(StreamType.Arbitrary).addEdge(FFMPEG_OGG_EDGE);