From 76c883fb8b741767fef169fe4969012b61921ee0 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Mon, 1 Oct 2012 14:27:25 +0200 Subject: [PATCH] Fix restoration of playing state after orientation change --- .../src/com/gst_sdk_tutorials/tutorial_1/Tutorial1.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 b849b67920..666a77dcaf 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 @@ -131,16 +131,16 @@ public class Tutorial1 extends Activity implements SurfaceHolder.Callback, OnSee if (mediaUri.startsWith("file://")) is_local_media = true; if (initialization_data != null) { - boolean should_play = initialization_data.getBoolean("playing"); + is_playing_desired = initialization_data.getBoolean("playing"); int milliseconds = initialization_data.getInt("position"); - Log.i ("GStreamer", "Restoring state, playing:" + should_play + " position:" + milliseconds + " ms."); + Log.i ("GStreamer", "Restoring state, playing:" + is_playing_desired + " 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 (should_play) { + if (is_playing_desired) { nativePlay(); } else { nativePause();