From: Sebastian Dröge Date: Mon, 1 Oct 2012 14:56:49 +0000 (+0200) Subject: Fix seeking X-Git-Tag: 1.19.3~489^2~562^2~164^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a4b1977d443444e15444e53d6764720017ed07c;p=platform%2Fupstream%2Fgstreamer.git Fix seeking --- diff --git a/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c index 912667a..df74084 100755 --- a/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c +++ b/gst-sdk/tutorials/android-tutorial-1/jni/tutorial-1.c @@ -129,6 +129,8 @@ static void execute_seek (gint64 desired_position, CustomData *data); static gboolean delayed_seek_cb (CustomData *data) { + GST_DEBUG ("Doing delayed seek %" GST_TIME_FORMAT, GST_TIME_ARGS (data->desired_position)); + data->last_seek_time = GST_CLOCK_TIME_NONE; execute_seek (data->desired_position, data); return FALSE; } @@ -224,10 +226,8 @@ static void state_changed_cb (GstBus *bus, GstMessage *msg, CustomData *data) { /* Only pay attention to messages coming from the pipeline, not its children */ if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->pipeline)) { data->state = new_state; - if (data->state >= GST_STATE_PAUSED && GST_CLOCK_TIME_IS_VALID (data->desired_position)) { + if (data->state >= GST_STATE_PAUSED && GST_CLOCK_TIME_IS_VALID (data->desired_position)) execute_seek (data->desired_position, data); - data->desired_position = GST_CLOCK_TIME_NONE; - } GST_DEBUG ("State changed to %s, notifying application", gst_element_state_get_name(new_state)); (*env)->CallVoidMethod (env, data->app, set_current_state_method_id, new_state); if ((*env)->ExceptionCheck (env)) {