From 336a85b92894e2b7a00b4bf1c71d2b836c7d5cd4 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Mon, 17 Sep 2012 18:26:55 +0200 Subject: [PATCH] Add comment regarding previoud rounding. --- .../src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java b/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java index 6a35e2e4fb..97ad13c86e 100755 --- a/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java +++ b/gst-sdk/tutorials/android-tutorial-1/src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java @@ -83,6 +83,10 @@ public class Tutorial1 extends Activity implements SurfaceHolder.Callback, OnSee playing = savedInstanceState.getBoolean("playing"); int milliseconds = savedInstanceState.getInt("position"); Log.i ("GStreamer", "Restoring state, playing:" + playing + " position:" + milliseconds + " ms."); + /* Actually, move to one millisecond in the future. Otherwise, due to rounding errors between the + * milliseconds used here and the nanoseconds used by GStreamer, we would be jumping a bit behind + * where we were before. This, combined with seeking to keyframe positions, would skip one keyframe + * backwards on each iteration. */ nativeSetPosition(milliseconds + 1); if (playing) { nativePlay();