diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2021-03-08 12:27:15 +0300 |
---|---|---|
committer | Stéphane Cerveau <scerveau@collabora.com> | 2021-03-08 18:37:31 +0300 |
commit | 0da1721364282c206951ce81163a3c83a7946dea (patch) | |
tree | 6fb497947757c8703850e8254f6534c71fe2087e | |
parent | d093b2894b5bfe76899f9884fad16b4160ffe561 (diff) |
element: remove useless ret test
The ret test is unrelevant and confusing.
We dont want the code to fail and the register
to succeed by example.
In the case of a conditional element_init,
the element should be defined with
GST_ELEMENT_REGISTER_DEFINE_CUSTOM instead
of GST_ELEMENT_REGISTER_DEFINE_WITH_CODE.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/768>
-rw-r--r-- | gst/gstelement.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gst/gstelement.h b/gst/gstelement.h index 3a306ccca5..6b12ad2326 100644 --- a/gst/gstelement.h +++ b/gst/gstelement.h @@ -35,7 +35,6 @@ G_BEGIN_DECLS G_BEGIN_DECLS \ gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \ { \ - gboolean ret = FALSE; \ { /** @@ -43,8 +42,7 @@ gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \ */ #define _GST_ELEMENT_REGISTER_DEFINE_END(element_name, rank, type) \ } \ - ret |= gst_element_register (plugin, element_name, rank, type); \ - return ret; \ + return gst_element_register (plugin, element_name, rank, type); \ } \ G_END_DECLS @@ -113,7 +111,7 @@ G_END_DECLS * * ``` * #define _pre_register_init \ - * ret |= my_stream_filter_pre_register (plugin); + * my_stream_filter_pre_register (plugin); * GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER, _pre_register_init) * ``` * |