mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 09:34:44 +01:00
Merge remote-tracking branch 'upstream/master' into tonemap
This commit is contained in:
@@ -675,11 +675,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
return System.IO.Path.Combine(basePath, "channels", ChannelId.ToString("N", CultureInfo.InvariantCulture), Id.ToString("N", CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
var idString = Id.ToString("N", CultureInfo.InvariantCulture);
|
||||
ReadOnlySpan<char> idString = Id.ToString("N", CultureInfo.InvariantCulture);
|
||||
|
||||
basePath = System.IO.Path.Combine(basePath, "library");
|
||||
|
||||
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
|
||||
return System.IO.Path.Join(basePath, idString.Slice(0, 2), idString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -702,26 +702,27 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
foreach (var removeChar in ConfigurationManager.Configuration.SortRemoveCharacters)
|
||||
{
|
||||
sortable = sortable.Replace(removeChar, string.Empty);
|
||||
sortable = sortable.Replace(removeChar, string.Empty, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
foreach (var replaceChar in ConfigurationManager.Configuration.SortReplaceCharacters)
|
||||
{
|
||||
sortable = sortable.Replace(replaceChar, " ");
|
||||
sortable = sortable.Replace(replaceChar, " ", StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
foreach (var search in ConfigurationManager.Configuration.SortRemoveWords)
|
||||
{
|
||||
// Remove from beginning if a space follows
|
||||
if (sortable.StartsWith(search + " "))
|
||||
if (sortable.StartsWith(search + " ", StringComparison.Ordinal))
|
||||
{
|
||||
sortable = sortable.Remove(0, search.Length + 1);
|
||||
}
|
||||
|
||||
// Remove from middle if surrounded by spaces
|
||||
sortable = sortable.Replace(" " + search + " ", " ");
|
||||
sortable = sortable.Replace(" " + search + " ", " ", StringComparison.Ordinal);
|
||||
|
||||
// Remove from end if followed by a space
|
||||
if (sortable.EndsWith(" " + search))
|
||||
if (sortable.EndsWith(" " + search, StringComparison.Ordinal))
|
||||
{
|
||||
sortable = sortable.Remove(sortable.Length - (search.Length + 1));
|
||||
}
|
||||
@@ -751,6 +752,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
builder.Append(chunkBuilder);
|
||||
}
|
||||
|
||||
// logger.LogDebug("ModifySortChunks Start: {0} End: {1}", name, builder.ToString());
|
||||
return builder.ToString().RemoveDiacritics();
|
||||
}
|
||||
|
||||
@@ -1630,7 +1630,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
outputVideoCodec ??= string.Empty;
|
||||
|
||||
var outputSizeParam = string.Empty;
|
||||
var outputSizeParam = ReadOnlySpan<char>.Empty;
|
||||
var request = state.BaseRequest;
|
||||
|
||||
// Add resolution params, if specified
|
||||
@@ -1644,42 +1644,42 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var index = outputSizeParam.IndexOf("hwupload,tonemap_opencl", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = outputSizeParam.IndexOf("hwdownload", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = outputSizeParam.IndexOf("hwupload=extra_hw_frames", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = outputSizeParam.IndexOf("format", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = outputSizeParam.IndexOf("yadif", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
index = outputSizeParam.IndexOf("scale", StringComparison.OrdinalIgnoreCase);
|
||||
if (index != -1)
|
||||
{
|
||||
outputSizeParam = outputSizeParam.Substring(index);
|
||||
outputSizeParam = outputSizeParam.Slice(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1735,9 +1735,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
// Setup default filtergraph utilizing FFMpeg overlay() and FFMpeg scale() (see the return of this function for index reference)
|
||||
// Always put the scaler before the overlay for better performance
|
||||
var retStr = !string.IsNullOrEmpty(outputSizeParam) ?
|
||||
" -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}]{3}[base];[base][sub]overlay\"" :
|
||||
" -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}][sub]overlay\"";
|
||||
var retStr = !outputSizeParam.IsEmpty
|
||||
? " -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}]{3}[base];[base][sub]overlay\""
|
||||
: " -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}][sub]overlay\"";
|
||||
|
||||
// When the input may or may not be hardware VAAPI decodable
|
||||
if (string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase))
|
||||
@@ -1771,7 +1771,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
*/
|
||||
if (isLinux)
|
||||
{
|
||||
retStr = !string.IsNullOrEmpty(outputSizeParam) ?
|
||||
retStr = !outputSizeParam.IsEmpty ?
|
||||
" -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}]{3}[base];[base][sub]overlay_qsv\"" :
|
||||
" -filter_complex \"[{0}:{1}]{4}[sub];[0:{2}][sub]overlay_qsv\"";
|
||||
}
|
||||
@@ -1783,7 +1783,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
mapPrefix,
|
||||
subtitleStreamIndex,
|
||||
state.VideoStream.Index,
|
||||
outputSizeParam,
|
||||
outputSizeParam.ToString(),
|
||||
videoSizeParam);
|
||||
}
|
||||
|
||||
@@ -2215,7 +2215,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|| state.DeInterlace("h265", true)
|
||||
|| state.DeInterlace("hevc", true))
|
||||
{
|
||||
var deintParam = string.Empty;
|
||||
string deintParam;
|
||||
var inputFramerate = videoStream?.RealFrameRate;
|
||||
|
||||
// If it is already 60fps then it will create an output framerate that is much too high for roku and others to handle
|
||||
@@ -2278,7 +2278,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of threads.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user