sys/ximage/gstximagesrc.c: Catch the case where no clock has been set.
authorJan Schmidt <thaytan@mad.scientist.com>
Sun, 4 Mar 2007 14:56:53 +0000 (14:56 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Sun, 4 Mar 2007 14:56:53 +0000 (14:56 +0000)
Original commit message from CVS:
* sys/ximage/gstximagesrc.c: (gst_ximage_src_create):
Catch the case where no clock has been set.

ChangeLog
sys/ximage/gstximagesrc.c

index 19b11ab..e656667 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-03-04  Jan Schmidt  <thaytan@mad.scientist.com>
 
+       * sys/ximage/gstximagesrc.c: (gst_ximage_src_create):
+       Catch the case where no clock has been set.
+
+2007-03-04  Jan Schmidt  <thaytan@mad.scientist.com>
+
        * ext/flac/gstflacenc.c: (gst_flac_enc_finalize):
        * ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_class_init),
        (gst_gconf_audio_sink_dispose), (gst_gconf_audio_sink_finalize):
index d695837..024f7c6 100644 (file)
@@ -658,6 +658,13 @@ gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf)
    * before capturing */
 
   GST_OBJECT_LOCK (s);
+  if (GST_ELEMENT_CLOCK (s) == NULL) {
+    GST_OBJECT_UNLOCK (s);
+    GST_ELEMENT_ERROR (s, RESOURCE, FAILED,
+        (_("Cannot operate without a clock")), (NULL));
+    return GST_FLOW_ERROR;
+  }
+
   base_time = GST_ELEMENT_CAST (s)->base_time;
   next_capture_ts = gst_clock_get_time (GST_ELEMENT_CLOCK (s));
   next_capture_ts -= base_time;