mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
Fix BD and DVD folder probing and playback
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#pragma warning disable CS1591
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
|
||||
namespace MediaBrowser.MediaEncoding.Encoder
|
||||
@@ -15,21 +17,38 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||
return string.Format(CultureInfo.InvariantCulture, "\"{0}\"", inputFile);
|
||||
}
|
||||
|
||||
return GetConcatInputArgument(inputFile, inputPrefix);
|
||||
return GetFileInputArgument(inputFile, inputPrefix);
|
||||
}
|
||||
|
||||
public static string GetInputArgument(string inputPrefix, IReadOnlyList<string> inputFiles, MediaProtocol protocol)
|
||||
{
|
||||
if (protocol != MediaProtocol.File)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "\"{0}\"", inputFiles[0]);
|
||||
}
|
||||
|
||||
return GetConcatInputArgument(inputFiles, inputPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the concat input argument.
|
||||
/// </summary>
|
||||
/// <param name="inputFile">The input file.</param>
|
||||
/// <param name="inputFiles">The input files.</param>
|
||||
/// <param name="inputPrefix">The input prefix.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
private static string GetConcatInputArgument(string inputFile, string inputPrefix)
|
||||
private static string GetConcatInputArgument(IReadOnlyList<string> inputFiles, string inputPrefix)
|
||||
{
|
||||
// Get all streams
|
||||
// If there's more than one we'll need to use the concat command
|
||||
if (inputFiles.Count > 1)
|
||||
{
|
||||
var files = string.Join("|", inputFiles.Select(NormalizePath));
|
||||
|
||||
return string.Format(CultureInfo.InvariantCulture, "concat:\"{0}\"", files);
|
||||
}
|
||||
|
||||
// Determine the input path for video files
|
||||
return GetFileInputArgument(inputFile, inputPrefix);
|
||||
return GetFileInputArgument(inputFiles[0], inputPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user