Fallback to no HWA when reporting transcoding info

This commit is contained in:
nyanmisaka 2022-03-06 00:12:16 +08:00
parent bfc27e494b
commit 3bf83025f2

View File

@ -458,9 +458,12 @@ namespace Jellyfin.Api.Helpers
var audioCodec = state.ActualOutputAudioCodec;
var videoCodec = state.ActualOutputVideoCodec;
var hardwareAccelerationTypeString = _serverConfigurationManager.GetEncodingOptions().HardwareAccelerationType;
HardwareEncodingType? hardwareAccelerationType = string.IsNullOrEmpty(hardwareAccelerationTypeString)
? null
: (HardwareEncodingType)Enum.Parse(typeof(HardwareEncodingType), hardwareAccelerationTypeString, true);
HardwareEncodingType? hardwareAccelerationType = null;
if (!string.IsNullOrEmpty(hardwareAccelerationTypeString)
&& Enum.TryParse<HardwareEncodingType>(hardwareAccelerationTypeString, out var parsedHardwareAccelerationType))
{
hardwareAccelerationType = parsedHardwareAccelerationType;
}
_sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo
{