From 0da1721364282c206951ce81163a3c83a7946dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Mon, 8 Mar 2021 10:27:15 +0100 Subject: [PATCH] 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: --- gst/gstelement.h | 6 ++---- 1 file 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) * ``` *