resolve conflicts

This commit is contained in:
Nyanmisaka 2020-08-03 14:55:28 +08:00 committed by GitHub
parent 17527d68df
commit 7b3f76b81f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1647,57 +1647,26 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
outputSizeParam = GetOutputSizeParam(state, options, outputVideoCodec).TrimEnd('"'); outputSizeParam = GetOutputSizeParam(state, options, outputVideoCodec).TrimEnd('"');
var index = outputSizeParam.IndexOf("hwupload,tonemap_opencl", StringComparison.OrdinalIgnoreCase); // All possible beginning of video filters
// Don't break the order
string[] beginOfParam = new[]
{
"hwupload,tonemap_opencl",
"hwupload=extra_hw_frames",
"vpp",
"hwdownload",
"format",
"yadif",
"scale"
};
for (int i = 0, index = -1; i < beginOfParam.Length; i++)
{
index = outputSizeParam.IndexOf(beginOfParam[i], StringComparison.OrdinalIgnoreCase);
if (index != -1) if (index != -1)
{ {
outputSizeParam = outputSizeParam.Slice(index); outputSizeParam = outputSizeParam.Slice(index);
} break;
else
{
index = outputSizeParam.IndexOf("hwdownload", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
index = outputSizeParam.IndexOf("hwupload=extra_hw_frames", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
index = outputSizeParam.IndexOf("format", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
index = outputSizeParam.IndexOf("yadif", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
index = outputSizeParam.IndexOf("scale", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
else
{
index = outputSizeParam.IndexOf("vpp", StringComparison.OrdinalIgnoreCase);
if (index != -1)
{
outputSizeParam = outputSizeParam.Slice(index);
}
}
}
}
}
} }
} }
} }