From 7f83d0233b8dfc1fd5030604cc1a2d918109b0ca Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 4 Mar 2007 14:56:53 +0000 Subject: [PATCH] sys/ximage/gstximagesrc.c: Catch the case where no clock has been set. Original commit message from CVS: * sys/ximage/gstximagesrc.c: (gst_ximage_src_create): Catch the case where no clock has been set. --- ChangeLog | 5 +++++ sys/ximage/gstximagesrc.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19b11ab0f5..e656667c70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-03-04 Jan Schmidt + + * sys/ximage/gstximagesrc.c: (gst_ximage_src_create): + Catch the case where no clock has been set. + 2007-03-04 Jan Schmidt * ext/flac/gstflacenc.c: (gst_flac_enc_finalize): diff --git a/sys/ximage/gstximagesrc.c b/sys/ximage/gstximagesrc.c index d695837f49..024f7c6389 100644 --- a/sys/ximage/gstximagesrc.c +++ b/sys/ximage/gstximagesrc.c @@ -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;