From 36295aa833bf5d152613500a4546aa76314150a8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 3 Jan 2015 14:38:22 -0500 Subject: use SocketHttpListener project --- MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs') diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs index c76f78009..b34a4cd38 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs @@ -41,7 +41,7 @@ namespace MediaBrowser.MediaEncoding.Encoder // If there's more than one we'll need to use the concat command if (inputFiles.Count > 1) { - var files = string.Join("|", inputFiles); + var files = string.Join("|", inputFiles.Select(NormalizePath).ToArray()); return string.Format("concat:\"{0}\"", files); } @@ -57,9 +57,23 @@ namespace MediaBrowser.MediaEncoding.Encoder /// System.String. private static string GetFileInputArgument(string path) { + // Quotes are valid path characters in linux and they need to be escaped here with a leading \ + path = NormalizePath(path); + return string.Format("file:\"{0}\"", path); } + /// + /// Normalizes the path. + /// + /// The path. + /// System.String. + private static string NormalizePath(string path) + { + // Quotes are valid path characters in linux and they need to be escaped here with a leading \ + return path.Replace("\"", "\\\""); + } + public static string GetProbeSizeArgument(bool isDvd) { return isDvd ? "-probesize 1G -analyzeduration 200M" : string.Empty; -- cgit v1.2.3