fixed #5816: Handle illegal output file path

This commit is contained in:
Jaex 2021-09-15 03:08:41 +03:00
parent b03bf28dd1
commit c7c4b0807a

View file

@ -135,9 +135,16 @@ private void UpdateOptions()
lblVideoQualityValue.Text = Options.VideoQuality.ToString();
if (!Options.UseCustomArguments)
{
try
{
txtArguments.Text = Options.GetFFmpegArgs();
}
catch
{
txtArguments.Text = "";
}
}
lblVideoCodec.Visible = cbVideoCodec.Visible = !Options.UseCustomArguments;
txtArguments.Visible = Options.UseCustomArguments;
@ -159,6 +166,8 @@ private bool StartEncoding()
ffmpeg.TrackEncodeProgress = true;
ffmpeg.EncodeProgressChanged += Manager_EncodeProgressChanged;
try
{
string outputFilePath = Options.OutputFilePath;
string args = Options.Arguments;
result = ffmpeg.Run(args);
@ -168,6 +177,11 @@ private bool StartEncoding()
Helpers.OpenFolderWithFile(outputFilePath);
}
}
catch (Exception e)
{
e.ShowError();
}
}
}
return result;