From 7688db602fcd86015f0baa13f760567c4a28da16 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 15 Nov 2005 12:35:45 +0000 Subject: [PATCH] gst/elements/gstfakesrc.c (gst_fake_src_create): It's not an error if the user selected "no clock" as the clocking me... Original commit message from CVS: 2005-11-15 Andy Wingo * gst/elements/gstfakesrc.c (gst_fake_src_create): It's not an error if the user selected "no clock" as the clocking method. --- ChangeLog | 3 +++ gst/elements/gstfakesrc.c | 13 ++++++++----- plugins/elements/gstfakesrc.c | 13 ++++++++----- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 612319d..7e3472db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2005-11-15 Andy Wingo + * 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. diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index 350fd0a..c1a2efc 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -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; } diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 350fd0a..c1a2efc 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -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; } -- 2.7.4