+2004-11-02 Kjartan Maraas <as at gnome.org>
+
+ reviewed by: Wim Taymans, Ronald Bultje.
+
+ * gst/cothreads.c: (cothread_create):
+ * gst/gstbin.c: (gst_bin_add_func), (gst_bin_remove_func),
+ (gst_bin_child_state_change_func):
+ * gst/gstbuffer.c: (gst_buffer_span):
+ * gst/gstelement.c: (gst_element_get_index),
+ (gst_element_get_event_masks), (gst_element_get_query_types),
+ (gst_element_get_formats):
+ * gst/gsterror.c: (_gst_core_errors_init),
+ (_gst_library_errors_init), (_gst_resource_errors_init),
+ (_gst_stream_errors_init):
+ * gst/gstobject.c: (gst_object_default_deep_notify):
+ * gst/gstpad.c: (gst_pad_get_event_masks),
+ (gst_pad_get_internal_links_default):
+ * gst/gstplugin.c: (gst_plugin_register_func),
+ (gst_plugin_get_module):
+ * gst/gststructure.c: (gst_structure_get_string),
+ (gst_structure_get_abbrs), (gst_structure_from_abbr),
+ (gst_structure_to_abbr):
+ * gst/gstutils.c: (gst_print_element_args):
+ * gst/schedulers/gstoptimalscheduler.c: (add_to_group),
+ (setup_group_scheduler), (gst_opt_scheduler_iterate):
+ Aplied part of patch #157127: Cleanup of issues reported by
+ sparse.
+ Also do not try to use cothreads when there is no cothread
+ context yet.
+
2004-11-02 Sebastien Cote <sc5 at hermes.usherb.ca>
* gst/schedulers/gstoptimalscheduler.c: (add_to_group),
cothread_create (cothread_context * ctx)
{
cothread_state *cothread;
- void *mmaped = 0;
+ void *mmaped = NULL;
gint slot = 0;
unsigned long page_size;
/* bump our internal state counter */
state = GST_STATE (element);
- while (state >>= 1)
+ while ((state >>= 1) != 0)
state_idx++;
bin->child_states[state_idx]++;
/* bump our internal state counter */
state = GST_STATE (element);
- while (state >>= 1)
+ while ((state >>= 1) != 0)
state_idx++;
bin->child_states[state_idx]--;
old = oldstate;
new = newstate;
- while (old >>= 1)
+ while ((old >>= 1) != 0)
old_idx++;
- while (new >>= 1)
+ while ((new >>= 1) != 0)
new_idx++;
GST_LOCK (bin);
{
GstBuffer *newbuf;
- g_return_val_if_fail (buf1 != NULL && buf2 != NULL, FALSE);
+ g_return_val_if_fail (buf1 != NULL && buf2 != NULL, NULL);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf1) > 0, NULL);
g_return_val_if_fail (GST_BUFFER_REFCOUNT_VALUE (buf2) > 0, NULL);
g_return_val_if_fail (len > 0, NULL);
{
GstElementClass *oclass;
- g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_GET_CLASS (element);
{
GstElementClass *oclass;
- g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_GET_CLASS (element);
return gst_pad_get_event_masks (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
{
GstElementClass *oclass;
- g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_GET_CLASS (element);
return gst_pad_get_query_types (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
{
GstElementClass *oclass;
- g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
+ g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
oclass = GST_ELEMENT_GET_CLASS (element);
return gst_pad_get_formats (GST_PAD_PEER (pad));
}
- return FALSE;
+ return NULL;
}
/**
/* initialize the dynamic table of translated core errors */
static gchar **
-_gst_core_errors_init ()
+_gst_core_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated library errors */
static gchar **
-_gst_library_errors_init ()
+_gst_library_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated resource errors */
static gchar **
-_gst_resource_errors_init ()
+_gst_resource_errors_init (void)
{
gchar **t = NULL;
/* initialize the dynamic table of translated stream errors */
static gchar **
-_gst_stream_errors_init ()
+_gst_stream_errors_init (void)
{
gchar **t = NULL;
GParamSpec * pspec, gchar ** excluded_props)
{
GValue value = { 0, }; /* the important thing is that value.type = 0 */
- gchar *str = 0;
+ gchar *str = NULL;
gchar *name = NULL;
if (pspec->flags & G_PARAM_READABLE) {
rpad = GST_PAD_REALIZE (pad);
- g_return_val_if_fail (rpad, FALSE);
+ g_return_val_if_fail (rpad, NULL);
if (GST_RPAD_EVENTMASKFUNC (rpad))
return GST_RPAD_EVENTMASKFUNC (rpad) (GST_PAD (pad));
GstPadDirection direction;
GstRealPad *rpad;
- g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
+ g_return_val_if_fail (GST_IS_PAD (pad), NULL);
rpad = GST_PAD_REALIZE (pad);
direction = rpad->direction;
/* static variables for segfault handling of plugin loading */
static char *_gst_plugin_fault_handler_filename = NULL;
-extern gboolean *_gst_disable_segtrap; /* see gst.c */
+extern gboolean _gst_disable_segtrap; /* see gst.c */
#ifndef HAVE_WIN32
-static gboolean *_gst_plugin_fault_handler_is_setup = FALSE;
+static gboolean _gst_plugin_fault_handler_is_setup = FALSE;
#endif
/* list of valid licenses.
if (GST_CAT_DEFAULT)
GST_INFO ("plugin \"%s\" has incompatible version, not loading",
plugin->filename);
- return FALSE;
+ return NULL;
}
if (!desc->license || !desc->description || !desc->package || !desc->origin) {
if (GST_CAT_DEFAULT)
GST_INFO ("plugin \"%s\" has incorrect GstPluginDesc, not loading",
plugin->filename);
- return FALSE;
+ return NULL;
}
if (!gst_plugin_check_license (desc->license)) {
if (GST_CAT_DEFAULT)
GST_INFO ("plugin \"%s\" has invalid license \"%s\", not loading",
plugin->filename, desc->license);
- return FALSE;
+ return NULL;
}
if (GST_CAT_DEFAULT)
if (GST_CAT_DEFAULT)
GST_INFO ("plugin \"%s\" failed to initialise", plugin->filename);
plugin->module = NULL;
- return FALSE;
+ return NULL;
}
if (GST_CAT_DEFAULT)
GModule *
gst_plugin_get_module (GstPlugin * plugin)
{
- g_return_val_if_fail (plugin != NULL, FALSE);
+ g_return_val_if_fail (plugin != NULL, NULL);
return plugin->module;
}
field = gst_structure_get_field (structure, fieldname);
if (field == NULL)
- return FALSE;
+ return NULL;
if (!G_VALUE_HOLDS_STRING (&field->value))
- return FALSE;
+ return NULL;
return g_value_get_string (&field->value);
}
{
guint width;
GValue value = { 0, }; /* the important thing is that value.type = 0 */
- gchar *str = 0;
+ gchar *str = NULL;
GParamSpec *spec, **specs, **walk;
specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (element), NULL);
wrapper = loop_group_schedule_function;
#ifdef USE_COTHREADS
- if (!(group->flags & GST_OPT_SCHEDULER_GROUP_SCHEDULABLE)) {
- do_cothread_create (group->cothread, osched->context,
- (cothread_func) wrapper, 0, (char **) group);
- } else {
- do_cothread_setfunc (group->cothread, osched->context,
- (cothread_func) wrapper, 0, (char **) group);
+ /* we can only initialize the cothread stuff when we have
+ * a cothread context */
+ if (osched->context) {
+ if (!(group->flags & GST_OPT_SCHEDULER_GROUP_SCHEDULABLE)) {
+ do_cothread_create (group->cothread, osched->context,
+ (cothread_func) wrapper, 0, (char **) group);
+ } else {
+ do_cothread_setfunc (group->cothread, osched->context,
+ (cothread_func) wrapper, 0, (char **) group);
+ }
}
#else
group->schedulefunc = wrapper;