From 6d973b4b080e0eaeaba2ab8efb5e71d7f5d5365b Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 20 Jul 2024 16:09:30 +0200 Subject: [PATCH] simplify logic --- src/renderer/src/hooks/useFfmpegOperations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/hooks/useFfmpegOperations.ts b/src/renderer/src/hooks/useFfmpegOperations.ts index 1853eb16..0aa5810e 100644 --- a/src/renderer/src/hooks/useFfmpegOperations.ts +++ b/src/renderer/src/hooks/useFfmpegOperations.ts @@ -424,8 +424,8 @@ function useFfmpegOperations({ filePath, treatInputFileModifiedTimeAsStart, trea const copyFileStreamsFiltered = [{ path: filePath, - // with smart cut, we only copy/cut *one* video stream, but *all* other streams (main file only) - streamIds: streamsToCopyFromMainFile.filter((stream) => !(stream.codec_type === 'video' && stream.index !== videoStreamIndex)).map((stream) => stream.index), + // with smart cut, we only copy/cut *one* video stream, and *all* other non-video streams (main file only) + streamIds: streamsToCopyFromMainFile.filter((stream) => stream.index === videoStreamIndex || stream.codec_type !== 'video').map((stream) => stream.index), }]; // eslint-disable-next-line no-shadow