mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user