From 0a13cfdaf19f1cb6a43baf6b6388f19ced38089a Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Thu, 15 Oct 2009 17:45:00 +0300 Subject: [PATCH] camerabin: set camerabin to READY before accessing the elements --- tests/examples/camerabin/gst-camera-perf.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/examples/camerabin/gst-camera-perf.c b/tests/examples/camerabin/gst-camera-perf.c index 0e21218162..9de6fc1565 100644 --- a/tests/examples/camerabin/gst-camera-perf.c +++ b/tests/examples/camerabin/gst-camera-perf.c @@ -560,6 +560,13 @@ setup_pipeline (void) GST_INFO_OBJECT (camera_bin, "elements created"); + if (GST_STATE_CHANGE_FAILURE == + gst_element_set_state (camera_bin, GST_STATE_READY)) { + g_warning ("can't set camerabin to ready\n"); + goto error; + } + GST_INFO_OBJECT (camera_bin, "camera ready"); + /* set properties */ g_object_set (camera_bin, "filename", filename->str, NULL); @@ -636,13 +643,6 @@ setup_pipeline (void) video_height, view_framerate_num, view_framerate_den, NULL); } - if (GST_STATE_CHANGE_FAILURE == - gst_element_set_state (camera_bin, GST_STATE_READY)) { - g_warning ("can't set camerabin to ready\n"); - goto error; - } - GST_INFO_OBJECT (camera_bin, "camera ready"); - if (GST_STATE_CHANGE_FAILURE == gst_element_set_state (camera_bin, GST_STATE_PLAYING)) { g_warning ("can't set camerabin to playing\n");