2005-11-15 Andy Wingo <wingo@pobox.com>
+ * gst/elements/gstfakesrc.c (gst_fake_src_create): It's not an
+ error if the user selected "no clock" as the clocking method.
+
* check/gst/gstpipeline.c (test_base_time): New test for buffer
timestamps with live capture.
GstClock *clock;
clock = gst_element_get_clock (GST_ELEMENT (src));
- g_return_val_if_fail (clock != NULL, GST_FLOW_ERROR);
- time = gst_clock_get_time (clock);
- time -= gst_element_get_base_time (GST_ELEMENT (src));
-
- gst_object_unref (clock);
+ if (clock) {
+ time = gst_clock_get_time (clock);
+ time -= gst_element_get_base_time (GST_ELEMENT (src));
+ gst_object_unref (clock);
+ } else {
+ /* not an error not to have a clock */
+ time = GST_CLOCK_TIME_NONE;
+ }
} else {
time = GST_CLOCK_TIME_NONE;
}
GstClock *clock;
clock = gst_element_get_clock (GST_ELEMENT (src));
- g_return_val_if_fail (clock != NULL, GST_FLOW_ERROR);
- time = gst_clock_get_time (clock);
- time -= gst_element_get_base_time (GST_ELEMENT (src));
-
- gst_object_unref (clock);
+ if (clock) {
+ time = gst_clock_get_time (clock);
+ time -= gst_element_get_base_time (GST_ELEMENT (src));
+ gst_object_unref (clock);
+ } else {
+ /* not an error not to have a clock */
+ time = GST_CLOCK_TIME_NONE;
+ }
} else {
time = GST_CLOCK_TIME_NONE;
}