gst/elements/gstfakesrc.c (gst_fake_src_create): It's not an error if the user select...
authorAndy Wingo <wingo@pobox.com>
Tue, 15 Nov 2005 12:35:45 +0000 (12:35 +0000)
committerAndy Wingo <wingo@pobox.com>
Tue, 15 Nov 2005 12:35:45 +0000 (12:35 +0000)
Original commit message from CVS:
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.

ChangeLog
gst/elements/gstfakesrc.c
plugins/elements/gstfakesrc.c

index 612319d..7e3472d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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.
 
index 350fd0a..c1a2efc 100644 (file)
@@ -704,12 +704,15 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
     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;
   }
index 350fd0a..c1a2efc 100644 (file)
@@ -704,12 +704,15 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
     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;
   }