gstreamer-0.10; GstDebugCategory initialization translated bad in C code
Submitted by and..@..ed.com
Link to original bug (#688901)
Description
Created attachment 229684 Intialize GstDebugCategory
See attached example source, compile like this valac --pkg gstreamer-0.10 test.vala -C
GstDebugCategory is declared in C like this:
static GstDebugCategory* vala_plugin_streaming_source_debug = NULL;
and initialized in .._base_init() like this: GstDebugCategory* tmp0; tmp0 = vala_plugin_streaming_source_debug; GST_DEBUG_CATEGORY_INIT (tmp0, ... )
This is wrong, because vala_plugin_streaming_source_debug will never be initialized, see: GST_DEBUG_CATEGORY_INIT
#define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{
if (cat == NULL)
cat = _gst_debug_category_new (name,color,description);
}G_STMT_END
Instead, vala should pass vala_plugin.._debug pointer directly to GST_DEBUG_CATEGORY_INIT.
tested with valac 0.18.0.35-fd2b22
Attachment 229684, "Intialize GstDebugCategory":
test.vala
Version: 0.18.x