Skip to content

Commit

Permalink
BUGFIX: stack overflow on automatic data aqcuisition of long video f…
Browse files Browse the repository at this point in the history
…iles (program crashes without any message)

VERSION: 6.4
  • Loading branch information
avosskuehler committed May 13, 2022
1 parent 0757d80 commit d0d1338
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Setup/Setup/Config.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<?define SupportPhone = "[email protected]"?>
<?define InstallDescription = "Video analysis for science education."?>
<?define UpgradeGuid = "{4830D7E5-685D-4637-B1BD-9A347BB911CF}"?>
<?define ProductVersion="6.3.1" ?>
<?define ProductVersion="6.4.1" ?>

<?if $(var.Platform) = x64 ?>
<?define ProductName = "Viana.NET" ?>
Expand Down
57 changes: 36 additions & 21 deletions VianaNET/Modules/Video/VideoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,22 @@ public void RunAutomaticDataAquisition()
/ this.TimelineSlider.FrameTimeInMS);
this.ProcessImage();

Video.Instance.StepOneFrame(true);
while (Video.Instance.IsDataAcquisitionRunning)
{
Video.Instance.StepOneFrame(true);

this.automaticDataAquisitionCurrentFrameCount++;
StatusBarContent.Instance.ProgressBarValue = (double)this.automaticDataAquisitionCurrentFrameCount
/ (this.automaticDataAquisitionTotalFrameCount - 1) * 100;

if (this.automaticDataAquisitionCurrentFrameCount == this.automaticDataAquisitionTotalFrameCount - 1
|| this.cancelCalculation)
{
this.AutomaticAquisitionFinished();
return;
}

}
}
else
{
Expand Down Expand Up @@ -910,26 +925,26 @@ private void VideoPlayerElementStepComplete(object sender, EventArgs e)
// });


// Run next sample
this.Dispatcher.Invoke(
(ThreadStart)delegate
{
if (Video.Instance.IsDataAcquisitionRunning)
{
this.automaticDataAquisitionCurrentFrameCount++;
StatusBarContent.Instance.ProgressBarValue = (double)this.automaticDataAquisitionCurrentFrameCount
/ (this.automaticDataAquisitionTotalFrameCount - 1) * 100;

if (this.automaticDataAquisitionCurrentFrameCount == this.automaticDataAquisitionTotalFrameCount - 1
|| this.cancelCalculation)
{
this.AutomaticAquisitionFinished();
return;
}

Video.Instance.StepOneFrame(true);
}
});
//// Run next sample
//this.Dispatcher.Invoke(
// (ThreadStart)delegate
// {
// if (Video.Instance.IsDataAcquisitionRunning)
// {
// this.automaticDataAquisitionCurrentFrameCount++;
// StatusBarContent.Instance.ProgressBarValue = (double)this.automaticDataAquisitionCurrentFrameCount
// / (this.automaticDataAquisitionTotalFrameCount - 1) * 100;

// if (this.automaticDataAquisitionCurrentFrameCount == this.automaticDataAquisitionTotalFrameCount - 1
// || this.cancelCalculation)
// {
// this.AutomaticAquisitionFinished();
// return;
// }

// Video.Instance.StepOneFrame(true);
// }
// });
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions VianaNET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("6.3.*")]
[assembly: AssemblyFileVersion("6.3.1")]
[assembly: AssemblyVersion("6.4.*")]
[assembly: AssemblyFileVersion("6.4.1")]
[assembly: Guid("1E23CAD1-6F4B-4a08-BF9B-91E27D8E2503")]

0 comments on commit d0d1338

Please sign in to comment.