From c73d444b8330b54eebaa4cf99f0028716fe9aec6 Mon Sep 17 00:00:00 2001 From: Adrien Allard Date: Fri, 19 Jan 2024 18:48:12 +0100 Subject: [PATCH] Fixes: Issue where file 'Error' in there name were generating false negative result (github issue #247). --- .../FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs | 7 +++++-- CHANGELOG.md | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs index dd84eb2..a935aad 100644 --- a/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs +++ b/Application/FileConverter/ConversionJobs/ConversionJob_FFMPEG.cs @@ -505,9 +505,12 @@ namespace FileConverter.ConversionJobs } } - if (input.Contains("Exiting.") || input.Contains("Error") || input.Contains("Unsupported dimensions") || input.Contains("No such file or directory")) + // Remove file names from log to avoid false negative when some words like 'Error' are in file name (github issue #247). + string inputWithoutFileNames = input.Replace(this.InputFilePath, string.Empty).Replace(this.OutputFilePath, string.Empty); + + if (inputWithoutFileNames.Contains("Exiting.") || inputWithoutFileNames.Contains("Error") || inputWithoutFileNames.Contains("Unsupported dimensions") || inputWithoutFileNames.Contains("No such file or directory")) { - if (input.StartsWith("Error while decoding stream") && input.EndsWith("Invalid data found when processing input")) + if (inputWithoutFileNames.StartsWith("Error while decoding stream") && inputWithoutFileNames.EndsWith("Invalid data found when processing input")) { // It is normal for a transport stream to start with a broken frame. // https://trac.ffmpeg.org/ticket/1622 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8382709..2464f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Fixed: Issue where File Converter version upgrade download was not working due to an issue with https encryption. - Fixed: Issue where output video was not working correclty on some video players like Quick time (github issue #34) (thanks to Diego López Bugna). - Fixed: Issue where icons and images were blurry on high dpi device. +- Fixed: Issue where file 'Error' in there name were generating false negative result (github issue #247). - Tech: Complete rework of the project architecture to be able to improve it in a long term perspective. The project is now using the MVVM Community Toolkit and is following more closely this design pattern. - Tech: Update ffmpeg to v6.1.1 and ImageMagick to v13.5. - Tech: Update SharpShell to v2.7.2.