From c05337562cb98eb1c08a68147c2ed88e230c8203 Mon Sep 17 00:00:00 2001 From: Jonas Kamsker <11245306+JKamsker@users.noreply.github.com> Date: Wed, 12 Jan 2022 00:31:47 +0100 Subject: [PATCH] Fixed GetText to pleasure the unit test --- FFMpegCore/FFMpeg/FFMpegArguments.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/FFMpegCore/FFMpeg/FFMpegArguments.cs b/FFMpegCore/FFMpeg/FFMpegArguments.cs index edc2606..4546dbe 100644 --- a/FFMpegCore/FFMpeg/FFMpegArguments.cs +++ b/FFMpegCore/FFMpeg/FFMpegArguments.cs @@ -23,13 +23,19 @@ private FFMpegArguments() { } private string GetText() { var sb = new StringBuilder(); + var appendSpace = false; foreach (var arg in _globalArguments.Arguments.Concat(Arguments)) { - if (sb.Length != 0) + if (appendSpace) { sb.Append(' '); } + else + { + appendSpace = true; + } + sb.Append(arg is IDynamicArgument dynArg ? dynArg.GetText(sb) : arg.Text); } @@ -99,4 +105,4 @@ internal void Post() argument.Post(); } } -} \ No newline at end of file +}