Merge pull request #16872 from psavarmattas/fix/priority-class-warning-spam
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Format / format-check (push) Waiting to run
Tests / run-tests (macos-latest) (push) Waiting to run
Tests / run-tests (ubuntu-latest) (push) Waiting to run
Tests / run-tests (windows-latest) (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Artifact (push) Waiting to run
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Blocked by required conditions
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Blocked by required conditions
Project Automation / Project board (push) Waiting to run
Merge Conflict Labeler / Labeling (push) Waiting to run

fix: suppress repeated PriorityClass warning in MediaEncoder
This commit is contained in:
Bond-009 2026-05-23 19:22:34 +02:00 • committed by GitHub
commit 31f4ce93a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,6 +85,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
private bool _isVaapiDeviceSupportVulkanDrmModifier = false;
private bool _isVaapiDeviceSupportVulkanDrmInterop = false;
private bool _canSetProcessPriority = true;
private bool _isVideoToolboxAv1DecodeAvailable = false;
private static string[] _vulkanImageDrmFmtModifierExts =
@ -1123,13 +1125,17 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
process.Process.Start();
try
if (_canSetProcessPriority)
{
process.Process.PriorityClass = ProcessPriorityClass.BelowNormal;
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Unable to set process priority to BelowNormal for {ProcessFileName}", process.Process.StartInfo.FileName);
try
{
process.Process.PriorityClass = ProcessPriorityClass.BelowNormal;
}
catch (Exception ex)
{
_canSetProcessPriority = false;
_logger.LogWarning(ex, "Unable to set process priority to BelowNormal for {ProcessFileName}. Further attempts will be skipped.", process.Process.StartInfo.FileName);
}
}
lock (_runningProcessesLock)