From: Stian Selnes Date: Wed, 5 Aug 2015 07:59:39 +0000 (+0200) Subject: harness: Allow-none for custom stress init func X-Git-Tag: 1.6.1~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=615e5b01c6426e3e8cdb09bb56c962f3893bda6f;p=platform%2Fupstream%2Fgstreamer.git harness: Allow-none for custom stress init func It should be allowed to not have a function to initialize the user data since it's often not necessary; it may already be initialized. https://bugzilla.gnome.org/show_bug.cgi?id=754661 --- diff --git a/libs/gst/check/gstharness.c b/libs/gst/check/gstharness.c index 245c5b1..cfaa586 100644 --- a/libs/gst/check/gstharness.c +++ b/libs/gst/check/gstharness.c @@ -2629,7 +2629,8 @@ gst_harness_stress_custom_func (GstHarnessThread * t) GstHarnessCustomThread *ct = (GstHarnessCustomThread *) t; guint count = 0; - ct->init (ct, ct->data); + if (ct->init != NULL) + ct->init (ct, ct->data); while (t->running) { ct->callback (ct, ct->data); @@ -2829,7 +2830,7 @@ gst_harness_stress_thread_stop (GstHarnessThread * t) /** * gst_harness_stress_custom_start: (skip) * @h: a #GstHarness - * @init: a #GFunc that is called initially and only once + * @init: (allow-none): a #GFunc that is called initially and only once * @callback: a #GFunc that is called as often as possible * @data: a #gpointer with custom data to pass to the @callback function * @sleep: a #gulong specifying how long to sleep in (microseconds) for