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

@ -136,7 +136,14 @@ private void UpdateOptions()
if (!Options.UseCustomArguments) if (!Options.UseCustomArguments)
{ {
txtArguments.Text = Options.GetFFmpegArgs(); try
{
txtArguments.Text = Options.GetFFmpegArgs();
}
catch
{
txtArguments.Text = "";
}
} }
lblVideoCodec.Visible = cbVideoCodec.Visible = !Options.UseCustomArguments; lblVideoCodec.Visible = cbVideoCodec.Visible = !Options.UseCustomArguments;
@ -159,13 +166,20 @@ private bool StartEncoding()
ffmpeg.TrackEncodeProgress = true; ffmpeg.TrackEncodeProgress = true;
ffmpeg.EncodeProgressChanged += Manager_EncodeProgressChanged; ffmpeg.EncodeProgressChanged += Manager_EncodeProgressChanged;
string outputFilePath = Options.OutputFilePath; try
string args = Options.Arguments;
result = ffmpeg.Run(args);
if (Options.AutoOpenFolder && result && !ffmpeg.StopRequested)
{ {
Helpers.OpenFolderWithFile(outputFilePath); string outputFilePath = Options.OutputFilePath;
string args = Options.Arguments;
result = ffmpeg.Run(args);
if (Options.AutoOpenFolder && result && !ffmpeg.StopRequested)
{
Helpers.OpenFolderWithFile(outputFilePath);
}
}
catch (Exception e)
{
e.ShowError();
} }
} }
} }