mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Minor fixes
This commit is contained in:
parent
519fde40e3
commit
1b67ea76f0
3 changed files with 7 additions and 5 deletions
|
@ -16,7 +16,7 @@ internal static class KeyValuePairExtensions
|
|||
public static string FormatArgumentPair(this KeyValuePair<string, string> pair, bool enclose)
|
||||
{
|
||||
var key = pair.Key;
|
||||
var value = enclose ? pair.Value.EncloseIfContainsSpace() : pair.Value;
|
||||
var value = enclose ? StringExtensions.EncloseIfContainsSpace(pair.Value) : pair.Value;
|
||||
|
||||
return $"{key}={value}";
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ internal static class StringExtensions
|
|||
/// </summary>
|
||||
/// <param name="input">The input</param>
|
||||
/// <returns>The enclosed string</returns>
|
||||
public static string EncloseIfContainsSpace(this string input)
|
||||
public static string EncloseIfContainsSpace(string input)
|
||||
{
|
||||
return input.Contains(" ") ? $"'{input}'" : input;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public static string EncloseIfContainsSpace(this string input)
|
|||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
public static string EncloseInQuotes(this string input)
|
||||
public static string EncloseInQuotes(string input)
|
||||
{
|
||||
return $"'{input}'";
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public static string EncloseInQuotes(this string input)
|
|||
/// </remarks>
|
||||
/// <param name="source"></param>
|
||||
/// <returns>Scaped path</returns>
|
||||
public static string ToFFmpegLibavfilterPath(this string source)
|
||||
public static string ToFFmpegLibavfilterPath(string source)
|
||||
{
|
||||
return source.Replace(CharactersSubstitution);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,9 @@ public SubtitleHardBurnOptions WithParameter(string key, string value)
|
|||
return this;
|
||||
}
|
||||
|
||||
internal string TextInternal => string.Join(":", new[] { _subtitle.ToFFmpegLibavfilterPath().EncloseInQuotes() }.Concat(Parameters.Select(parameter => parameter.FormatArgumentPair(enclose: true))));
|
||||
internal string TextInternal => string
|
||||
.Join(":", new[] { StringExtensions.EncloseInQuotes(StringExtensions.ToFFmpegLibavfilterPath(_subtitle)) }
|
||||
.Concat(Parameters.Select(parameter => parameter.FormatArgumentPair(enclose: true))));
|
||||
}
|
||||
|
||||
public class StyleOptions
|
||||
|
|
Loading…
Reference in a new issue