diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-01-04 09:27:54 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-01-04 09:27:54 -0500 |
| commit | c5ff30f66e368efc2ca7dea7813fba6d9f6a657c (patch) | |
| tree | c5552b898f66b7d510e9257eb8bbeafd6a003676 /MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs | |
| parent | 767590125b27c2498e3ad9544edbede30fb70f45 (diff) | |
| parent | 59b6bc28c332701d5e383fbf99170bdc740fb6cc (diff) | |
Merge pull request #965 from MediaBrowser/dev
3.0.5482.0
Diffstat (limited to 'MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs')
| -rw-r--r-- | MediaBrowser.MediaEncoding/Encoder/EncodingUtils.cs | 16 |
1 files changed, 15 insertions, 1 deletions
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 /// <returns>System.String.</returns> 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); } + /// <summary> + /// Normalizes the path. + /// </summary> + /// <param name="path">The path.</param> + /// <returns>System.String.</returns> + 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; |
