From 7315cf2916c0022f0031919807638276f59e5580 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 10 May 2020 23:16:52 +0200 Subject: [PATCH] Use ToLowerInvariant Former-commit-id: 188f37c9eebbf2e84cfbb38e310837244ef7b7eb --- FFMpegCore.Test/Resources/VideoLibrary.cs | 2 +- FFMpegCore/FFMpeg/Arguments/AudioCodecArgument.cs | 2 +- FFMpegCore/FFMpeg/Arguments/BitStreamFilterArgument.cs | 4 ++-- FFMpegCore/FFMpeg/Arguments/ForceFormatArgument.cs | 2 +- FFMpegCore/FFMpeg/Arguments/SpeedPresetArgument.cs | 2 +- FFMpegCore/FFMpeg/Arguments/VideoCodecArgument.cs | 2 +- FFMpegCore/ImageInfo.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/FFMpegCore.Test/Resources/VideoLibrary.cs b/FFMpegCore.Test/Resources/VideoLibrary.cs index 26ad6aa..90e809d 100644 --- a/FFMpegCore.Test/Resources/VideoLibrary.cs +++ b/FFMpegCore.Test/Resources/VideoLibrary.cs @@ -43,7 +43,7 @@ public static string OutputLocation(this FileInfo file, ImageType type) public static string OutputLocation(this FileInfo file, Enum type, string keyword) { string originalLocation = file.Directory.FullName, - outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToString().ToLower()); + outputFile = file.Name.Replace(file.Extension, keyword + "." + type.ToString().ToLowerInvariant()); return $"{originalLocation}{Path.DirectorySeparatorChar}{outputFile}"; } diff --git a/FFMpegCore/FFMpeg/Arguments/AudioCodecArgument.cs b/FFMpegCore/FFMpeg/Arguments/AudioCodecArgument.cs index 3b81ddd..76fac85 100644 --- a/FFMpegCore/FFMpeg/Arguments/AudioCodecArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/AudioCodecArgument.cs @@ -13,6 +13,6 @@ public AudioCodecArgument(AudioCodec audioCodec) AudioCodec = audioCodec; } - public string Text => $"-c:a {AudioCodec.ToString().ToLower()}"; + public string Text => $"-c:a {AudioCodec.ToString().ToLowerInvariant()}"; } } diff --git a/FFMpegCore/FFMpeg/Arguments/BitStreamFilterArgument.cs b/FFMpegCore/FFMpeg/Arguments/BitStreamFilterArgument.cs index 871df5e..e5a4b35 100644 --- a/FFMpegCore/FFMpeg/Arguments/BitStreamFilterArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/BitStreamFilterArgument.cs @@ -18,8 +18,8 @@ public BitStreamFilterArgument(Channel channel, Filter filter) public string Text => Channel switch { - Channel.Audio => $"-bsf:a {Filter.ToString().ToLower()}", - Channel.Video => $"-bsf:v {Filter.ToString().ToLower()}", + Channel.Audio => $"-bsf:a {Filter.ToString().ToLowerInvariant()}", + Channel.Video => $"-bsf:v {Filter.ToString().ToLowerInvariant()}", _ => string.Empty }; } diff --git a/FFMpegCore/FFMpeg/Arguments/ForceFormatArgument.cs b/FFMpegCore/FFMpeg/Arguments/ForceFormatArgument.cs index 503c6ec..3367f99 100644 --- a/FFMpegCore/FFMpeg/Arguments/ForceFormatArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/ForceFormatArgument.cs @@ -13,7 +13,7 @@ public ForceFormatArgument(string format) _format = format; } - public ForceFormatArgument(VideoCodec value) : this(value.ToString().ToLower()) { } + public ForceFormatArgument(VideoCodec value) : this(value.ToString().ToLowerInvariant()) { } public string Text => $"-f {_format}"; } diff --git a/FFMpegCore/FFMpeg/Arguments/SpeedPresetArgument.cs b/FFMpegCore/FFMpeg/Arguments/SpeedPresetArgument.cs index 401e2dd..6046c3c 100644 --- a/FFMpegCore/FFMpeg/Arguments/SpeedPresetArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/SpeedPresetArgument.cs @@ -14,6 +14,6 @@ public SpeedPresetArgument(Speed speed) Speed = speed; } - public string Text => $"-preset {Speed.ToString().ToLower()}"; + public string Text => $"-preset {Speed.ToString().ToLowerInvariant()}"; } } diff --git a/FFMpegCore/FFMpeg/Arguments/VideoCodecArgument.cs b/FFMpegCore/FFMpeg/Arguments/VideoCodecArgument.cs index 4e2b782..7c47592 100644 --- a/FFMpegCore/FFMpeg/Arguments/VideoCodecArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/VideoCodecArgument.cs @@ -14,7 +14,7 @@ public VideoCodecArgument(string codec) Codec = codec; } - public VideoCodecArgument(VideoCodec value) : this(value.ToString().ToLower()) { } + public VideoCodecArgument(VideoCodec value) : this(value.ToString().ToLowerInvariant()) { } public string Text => $"-c:v {Codec} -pix_fmt yuv420p"; } diff --git a/FFMpegCore/ImageInfo.cs b/FFMpegCore/ImageInfo.cs index f4b9aa4..cf8561e 100644 --- a/FFMpegCore/ImageInfo.cs +++ b/FFMpegCore/ImageInfo.cs @@ -16,7 +16,7 @@ public class ImageInfo /// Image file information. public ImageInfo(FileInfo fileInfo) { - if (!fileInfo.Extension.ToLower().EndsWith(FileExtension.Png)) + if (!fileInfo.Extension.ToLowerInvariant().EndsWith(FileExtension.Png)) { throw new Exception("Image joining currently suppors only .png file types"); }