From 84b20afe1fc6cb86d9ff8694b3e4524461dea588 Mon Sep 17 00:00:00 2001 From: dmitrylyzo <56478732+dmitrylyzo@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:09:54 -0400 Subject: [PATCH] Backport pull request #12575 from jellyfin/release-10.9.z Fix subtitle and attachment extraction when input path contains quotes Original-merge: 3c3ebe834462bbb7630ca4fc0c106cc51ca80e50 Merged-by: Bond-009 Backported-by: Joshua M. Boniface --- .../Attachments/AttachmentExtractor.cs | 4 ++-- MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs index 7e307286a..431fc0b17 100644 --- a/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs +++ b/MediaBrowser.MediaEncoding/Attachments/AttachmentExtractor.cs @@ -284,7 +284,7 @@ namespace MediaBrowser.MediaEncoding.Attachments if (extractableAttachmentIds.Count > 0) { - await CacheAllAttachmentsInternal(mediaPath, inputFile, mediaSource, extractableAttachmentIds, cancellationToken).ConfigureAwait(false); + await CacheAllAttachmentsInternal(mediaPath, _mediaEncoder.GetInputArgument(inputFile, mediaSource), mediaSource, extractableAttachmentIds, cancellationToken).ConfigureAwait(false); } } catch (Exception ex) @@ -323,7 +323,7 @@ namespace MediaBrowser.MediaEncoding.Attachments processArgs += string.Format( CultureInfo.InvariantCulture, - " -i \"{0}\" -t 0 -f null null", + " -i {0} -t 0 -f null null", inputFile); int exitCode; diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs index 9ecbfa9cf..dbb4b823e 100644 --- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs +++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs @@ -529,11 +529,11 @@ namespace MediaBrowser.MediaEncoding.Subtitles List subtitleStreams, CancellationToken cancellationToken) { - var inputPath = mediaSource.Path; + var inputPath = _mediaEncoder.GetInputArgument(mediaSource.Path, mediaSource); var outputPaths = new List(); var args = string.Format( CultureInfo.InvariantCulture, - "-i \"{0}\" -copyts", + "-i {0} -copyts", inputPath); foreach (var subtitleStream in subtitleStreams) @@ -704,7 +704,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles var processArgs = string.Format( CultureInfo.InvariantCulture, - "-i \"{0}\" -copyts -map 0:{1} -an -vn -c:s {2} \"{3}\"", + "-i {0} -copyts -map 0:{1} -an -vn -c:s {2} \"{3}\"", inputPath, subtitleStreamIndex, outputCodec,