aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-08-29 02:43:37 +0800
committerGitHub <noreply@github.com>2024-08-28 12:43:37 -0600
commit6c8ca30f7fc02170901a969c71dc35ec8992ad02 (patch)
tree20e674033780ce8254fd41e467c9c1fe3d03bdbc /MediaBrowser.Controller
parent8c3f3c503b4b0606e2987ed58e5228d72669afeb (diff)
Prevent server from starting if the ffmpeg path is invalid (#12463)
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs13
-rw-r--r--MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs10
2 files changed, 15 insertions, 8 deletions
diff --git a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
index 6c58064ce..0aaf4fcd9 100644
--- a/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
+++ b/MediaBrowser.Controller/Extensions/ConfigurationExtensions.cs
@@ -30,6 +30,11 @@ namespace MediaBrowser.Controller.Extensions
public const string FfmpegProbeSizeKey = "FFmpeg:probesize";
/// <summary>
+ /// The key for the skipping FFmpeg validation.
+ /// </summary>
+ public const string FfmpegSkipValidationKey = "FFmpeg:novalidation";
+
+ /// <summary>
/// The key for the FFmpeg analyze duration option.
/// </summary>
public const string FfmpegAnalyzeDurationKey = "FFmpeg:analyzeduration";
@@ -90,6 +95,14 @@ namespace MediaBrowser.Controller.Extensions
=> configuration[FfmpegAnalyzeDurationKey];
/// <summary>
+ /// Gets a value indicating whether the server should validate FFmpeg during startup.
+ /// </summary>
+ /// <param name="configuration">The configuration to read the setting from.</param>
+ /// <returns><c>true</c> if the server should validate FFmpeg during startup, otherwise <c>false</c>.</returns>
+ public static bool GetFFmpegSkipValidation(this IConfiguration configuration)
+ => configuration.GetValue<bool>(FfmpegSkipValidationKey);
+
+ /// <summary>
/// Gets a value indicating whether playlists should allow duplicate entries from the <see cref="IConfiguration"/>.
/// </summary>
/// <param name="configuration">The configuration to read the setting from.</param>
diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
index 038c6c7f6..e36106e52 100644
--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
@@ -223,14 +223,8 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <summary>
/// Sets the path to find FFmpeg.
/// </summary>
- void SetFFmpegPath();
-
- /// <summary>
- /// Updates the encoder path.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <param name="pathType">The type of path.</param>
- void UpdateEncoderPath(string path, string pathType);
+ /// <returns>bool indicates whether a valid ffmpeg is found.</returns>
+ bool SetFFmpegPath();
/// <summary>
/// Gets the primary playlist of .vob files.