mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
Rename ValidationRegex to ContainerValidationRegex
This commit is contained in:
parent
6d7950bddc
commit
1fcc79316d
6 changed files with 59 additions and 59 deletions
|
|
@ -37,7 +37,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
/// periods, underscores, commas, and vertical bars, with a length between 0 and 40 characters.
|
||||
/// This should matches all common valid codecs.
|
||||
/// </summary>
|
||||
public const string ValidationRegex = @"^[a-zA-Z0-9\-\._,|]{0,40}$";
|
||||
public const string ContainerValidationRegex = @"^[a-zA-Z0-9\-\._,|]{0,40}$";
|
||||
|
||||
private const string _defaultMjpegEncoder = "mjpeg";
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
private readonly Version _minFFmpegVaapiDeviceVendorId = new Version(7, 0, 1);
|
||||
private readonly Version _minFFmpegQsvVppScaleModeOption = new Version(6, 0);
|
||||
|
||||
private static readonly Regex _validationRegex = new(ValidationRegex, RegexOptions.Compiled);
|
||||
private static readonly Regex _containerValidationRegex = new(ContainerValidationRegex, RegexOptions.Compiled);
|
||||
|
||||
private static readonly string[] _videoProfilesH264 =
|
||||
[
|
||||
|
|
@ -452,7 +452,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
return GetMjpegEncoder(state, encodingOptions);
|
||||
}
|
||||
|
||||
if (_validationRegex.IsMatch(codec))
|
||||
if (_containerValidationRegex.IsMatch(codec))
|
||||
{
|
||||
return codec.ToLowerInvariant();
|
||||
}
|
||||
|
|
@ -493,7 +493,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
|
||||
public static string GetInputFormat(string container)
|
||||
{
|
||||
if (string.IsNullOrEmpty(container) || !_validationRegex.IsMatch(container))
|
||||
if (string.IsNullOrEmpty(container) || !_containerValidationRegex.IsMatch(container))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
@ -711,7 +711,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
{
|
||||
var codec = state.OutputAudioCodec;
|
||||
|
||||
if (!_validationRegex.IsMatch(codec))
|
||||
if (!_containerValidationRegex.IsMatch(codec))
|
||||
{
|
||||
codec = "aac";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue