[longomatch] Check the device element before doing anything



commit 90cf1b649381d97b6e0d957cb3feb6ea6b44e0f8
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon May 31 23:07:12 2010 +0200

    Check the device element before doing anything

 libcesarplayer/src/gst-camera-capturer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libcesarplayer/src/gst-camera-capturer.c b/libcesarplayer/src/gst-camera-capturer.c
index bc92a12..ef0ab38 100644
--- a/libcesarplayer/src/gst-camera-capturer.c
+++ b/libcesarplayer/src/gst-camera-capturer.c
@@ -1321,10 +1321,10 @@ gst_camera_capturer_enum_devices (gchar * device_name)
   guint i = 0;
 
   device = gst_element_factory_make (device_name, "source");
-  gst_element_set_state (device, GST_STATE_READY);
-  gst_element_get_state (device, NULL, NULL, 5 * GST_SECOND);
   if (!device || !GST_IS_PROPERTY_PROBE (device))
     goto finish;
+  gst_element_set_state (device, GST_STATE_READY);
+  gst_element_get_state (device, NULL, NULL, 5 * GST_SECOND);
   probe = GST_PROPERTY_PROBE (device);
   va = gst_property_probe_get_values_name (probe, "device-name");
   if (!va)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]