|There is this function in gestremer matroska demux plugin:
gboolean
gst_matroska_demux_plugin_init (GstPlugin * plugin)
{
/* parser helper separate debug */
GST_DEBUG_CATEGORY_INIT (ebmlread_debug, "ebmlread",
0, "EBML stream helper class");
/* create an elementfactory for the matroska_demux element */
if (!gst_element_register (plugin, "matroskademux",
GST_RANK_PRIMARY, GST_TYPE_MATROSKA_DEMUX))
return FALSE;
return TRUE;
}
Now gst_element_register() is type of
gboolean gst_element_register (GstPlugin *plugin,
const gchar *name,
guint rank,
GType type);
Returns :
TRUE, if the registering succeeded, FALSE on error
Then why not write it in the following way?
gboolean
gst_matroska_demux_plugin_init (GstPlugin * plugin)
{
/* parser helper separate debug */
GST_DEBUG_CATEGORY_INIT (ebmlread_debug, "ebmlread",
0, "EBML stream helper class");
/* create an elementfactory for the matroska_demux element */
return gst_element_register (plugin, "matroskademux",
GST_RANK_PRIMARY, GST_TYPE_MATROSKA_DEMUX))
}
As such there is no problem with the code. At least I wont penalize if anyone uses any of the mentioned snippets.
These are the reasons that I think are the cause:
Conclusion is what I said in the beginning. It does not matter as long as code is easy to understand. Regarding some optimization gains, I think for this compilers are intelligent enough to take care.