diff --git a/FinalRetimeWindow.xaml b/FinalRetimeWindow.xaml
index abfdc2c..f39a081 100644
--- a/FinalRetimeWindow.xaml
+++ b/FinalRetimeWindow.xaml
@@ -26,7 +26,7 @@
-
+
diff --git a/FinalRetimeWindow.xaml.cs b/FinalRetimeWindow.xaml.cs
index 7054c84..4dd03e5 100644
--- a/FinalRetimeWindow.xaml.cs
+++ b/FinalRetimeWindow.xaml.cs
@@ -12,9 +12,9 @@ public FinalRetimeWindow() {
public FinalRetimeWindow(TimeSpan wloads, TimeSpan loads) {
InitializeComponent();
- WLoads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", wloads);
- Loads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", loads);
- WOLoads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", wloads - loads);
+ WLoads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(wloads));
+ Loads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(loads));
+ WOLoads.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(wloads - loads));
}
private void Button_Click(object sender, RoutedEventArgs e) {
diff --git a/Info.xaml b/Info.xaml
index a34bdca..9410bc8 100644
--- a/Info.xaml
+++ b/Info.xaml
@@ -17,7 +17,7 @@
-
+
Controls:
A/D: go back/forwards 1 frame
diff --git a/LoadInfo.xaml.cs b/LoadInfo.xaml.cs
index cb68cd5..386c362 100644
--- a/LoadInfo.xaml.cs
+++ b/LoadInfo.xaml.cs
@@ -39,15 +39,18 @@ private void TryCalculate() {
LoadFrameDurationF.Content = "---";
LoadFrameDurationS.Content = "---";
if (frameStart > -1) {
- LoadFrameBeginS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", new TimeSpan((long)(frameStart / MainWindow.frameRate * 10_000_000)));
+ TimeSpan tmp = new TimeSpan((long)(frameStart / MainWindow.frameRate * 10_000_000));
+ LoadFrameBeginS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(tmp));
}
if (frameEnd > -1) {
- LoadFrameEndS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", new TimeSpan((long)(frameEnd / MainWindow.frameRate * 10_000_000)));
+ TimeSpan tmp = new TimeSpan((long)(frameEnd / MainWindow.frameRate * 10_000_000));
+ LoadFrameEndS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(tmp));
}
if (frameStart > -1 && frameEnd > -1) {
int frameDuration = FrameDuration();
LoadFrameDurationF.Content = String.Format("{0} frames", frameDuration);
- LoadFrameDurationS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", new TimeSpan((long)(frameDuration / MainWindow.frameRate * 10_000_000)));
+ TimeSpan tmp = new TimeSpan((long)(frameDuration / MainWindow.frameRate * 10_000_000));
+ LoadFrameDurationS.Content = String.Format("{0:hh\\:mm\\:ss\\.fff}", Helper.RoundTimeSpanMillis(tmp));
}
}
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index e063a11..dff2ecc 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -95,6 +95,7 @@ public MainWindow() {
timerAnalyzer.Tick += Analyzer_Tick;
timerAnalyzer.Start();
}
+
private void ButtonPlayPause_Click(object sender, RoutedEventArgs e) {
if (!Video.IsOpen) return;
if (Video.MediaState == Unosquare.FFME.Common.MediaPlaybackState.Play) {
@@ -441,4 +442,12 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e) {
}
}
}
+
+ class Helper {
+ public static TimeSpan RoundTimeSpanMillis(TimeSpan ts) {
+ long ticks = (long) Math.Round(ts.Ticks / 10_000.0) * 10_000;
+ var res = new TimeSpan(ticks);
+ return res;
+ }
+ }
}