Prevent server from starting if the ffmpeg path is invalid (#12463)

This commit is contained in:
gnattu
2024-08-29 02:43:37 +08:00
committed by GitHub
parent 8c3f3c503b
commit 6c8ca30f7f
6 changed files with 43 additions and 73 deletions

View File

@@ -402,7 +402,12 @@ namespace Emby.Server.Implementations
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
ConfigurationManager.NamedConfigurationUpdated += OnConfigurationUpdated;
Resolve<IMediaEncoder>().SetFFmpegPath();
var ffmpegValid = Resolve<IMediaEncoder>().SetFFmpegPath();
if (!ffmpegValid)
{
throw new FfmpegException("Failed to find valid ffmpeg");
}
Logger.LogInformation("ServerId: {ServerId}", SystemId);
Logger.LogInformation("Core startup complete");

View File

@@ -19,7 +19,8 @@ namespace Emby.Server.Implementations
{ FfmpegAnalyzeDurationKey, "200M" },
{ PlaylistsAllowDuplicatesKey, bool.FalseString },
{ BindToUnixSocketKey, bool.FalseString },
{ SqliteCacheSizeKey, "20000" }
{ SqliteCacheSizeKey, "20000" },
{ FfmpegSkipValidationKey, bool.FalseString }
};
}
}