Browse Source

fix startup on systems unsupported by nvencsharp (#2678)

pull/2679/head
Jason Dove 1 month ago committed by GitHub
parent
commit
b45c22092d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 8
      ErsatzTV.FFmpeg/Capabilities/HardwareCapabilitiesFactory.cs
  3. 4
      ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs
  4. 4
      ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs
  5. 4
      ErsatzTV/Services/RunOnce/PlatformSettingsService.cs

2
CHANGELOG.md

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased] ## [Unreleased]
### Fixed
- Fix startup on systems unsupported by NvEncSharp
## [25.9.0] - 2025-11-29 ## [25.9.0] - 2025-11-29
### Added ### Added

8
ErsatzTV.FFmpeg/Capabilities/HardwareCapabilitiesFactory.cs

@ -151,6 +151,10 @@ public partial class HardwareCapabilitiesFactory(
{ {
// do nothing // do nothing
} }
catch (TypeInitializationException)
{
// do nothing
}
// if we don't have a list of cuda devices, fall back to ffmpeg check // if we don't have a list of cuda devices, fall back to ffmpeg check
@ -644,6 +648,10 @@ public partial class HardwareCapabilitiesFactory(
{ {
// do nothing // do nothing
} }
catch (TypeInitializationException)
{
// do nothing
}
logger.LogWarning( logger.LogWarning(
"Error detecting NVIDIA GPU capabilities; some hardware accelerated features will be unavailable"); "Error detecting NVIDIA GPU capabilities; some hardware accelerated features will be unavailable");

4
ErsatzTV.FFmpeg/Capabilities/Nvidia/NvEncSharpRedirector.cs

@ -16,6 +16,10 @@ public static class NvEncSharpRedirector
{ {
CudaHelper.IsLoaded = false; CudaHelper.IsLoaded = false;
} }
catch (TypeInitializationException)
{
CudaHelper.IsLoaded = false;
}
} }
private static IntPtr Resolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) private static IntPtr Resolver(string libraryName, Assembly assembly, DllImportSearchPath? searchPath)

4
ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs

@ -463,6 +463,10 @@ public class TranscodingTests
{ {
// do nothing // do nothing
} }
catch (TypeInitializationException)
{
// do nothing
}
var localFileSystem = new LocalFileSystem( var localFileSystem = new LocalFileSystem(
new MockFileSystem(), new MockFileSystem(),

4
ErsatzTV/Services/RunOnce/PlatformSettingsService.cs

@ -27,6 +27,10 @@ public class PlatformSettingsService(IServiceScopeFactory serviceScopeFactory) :
{ {
// do nothing // do nothing
} }
catch (TypeInitializationException)
{
// do nothing
}
} }
if (runtimeInfo.IsOSPlatform(OSPlatform.Linux)) if (runtimeInfo.IsOSPlatform(OSPlatform.Linux))

Loading…
Cancel
Save