mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-22 11:19:25 +01:00
try/catch for UpdateFfmpegProgress
This commit is contained in:
@@ -174,19 +174,26 @@ namespace Flowframes
|
|||||||
|
|
||||||
public static void UpdateFfmpegProgress(string ffmpegTime)
|
public static void UpdateFfmpegProgress(string ffmpegTime)
|
||||||
{
|
{
|
||||||
Form1 form = Program.mainForm;
|
try
|
||||||
long currInDuration = (form.currInDurationCut < form.currInDuration) ? form.currInDurationCut : form.currInDuration;
|
|
||||||
|
|
||||||
if (currInDuration < 1)
|
|
||||||
{
|
{
|
||||||
Program.mainForm.SetProgress(0);
|
Form1 form = Program.mainForm;
|
||||||
return;
|
long currInDuration = (form.currInDurationCut < form.currInDuration) ? form.currInDurationCut : form.currInDuration;
|
||||||
}
|
|
||||||
|
|
||||||
long total = currInDuration / 100;
|
if (currInDuration < 1)
|
||||||
long current = FormatUtils.TimestampToMs(ffmpegTime);
|
{
|
||||||
int progress = Convert.ToInt32(current / total);
|
Program.mainForm.SetProgress(0);
|
||||||
Program.mainForm.SetProgress(progress);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
long total = currInDuration / 100;
|
||||||
|
long current = FormatUtils.TimestampToMs(ffmpegTime);
|
||||||
|
int progress = Convert.ToInt32(current / total);
|
||||||
|
Program.mainForm.SetProgress(progress);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Log($"Failed to get ffmpeg progress: {e.Message}", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static string GetAvDir ()
|
static string GetAvDir ()
|
||||||
|
|||||||
Reference in New Issue
Block a user