mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
gst/gstcaps.c: fix signedness issues in a (hopefully) correct way
Original commit message from CVS: * gst/gstcaps.c: (gst_caps_intersect): fix signedness issues in a (hopefully) correct way * gst/gstelement.c: (gst_element_pads_activate): some debugging * gst/gstobject.c: (gst_object_set_parent): some debugging
This commit is contained in:
parent
e145f9f8a0
commit
d81f2a6d5b
4 changed files with 23 additions and 4 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-10-17 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* gst/gstcaps.c: (gst_caps_intersect):
|
||||
fix signedness issues in a (hopefully) correct way
|
||||
* gst/gstelement.c: (gst_element_pads_activate):
|
||||
some debugging
|
||||
* gst/gstobject.c: (gst_object_set_parent):
|
||||
some debugging
|
||||
|
||||
2005-10-17 Julien MOUTTE <julien@moutte.net>
|
||||
|
||||
* gst/gstvalue.h: Fix prototypes.
|
||||
|
|
|
@ -955,7 +955,8 @@ gst_caps_structure_union (const GstStructure * struct1,
|
|||
GstCaps *
|
||||
gst_caps_intersect (const GstCaps * caps1, const GstCaps * caps2)
|
||||
{
|
||||
gint64 i, j, k; /* indexes can be up to 2 * sizeof (guint) */
|
||||
guint64 i; /* index can be up to 2 * G_MAX_UINT */
|
||||
guint j, k;
|
||||
|
||||
GstStructure *struct1;
|
||||
GstStructure *struct2;
|
||||
|
@ -1000,7 +1001,7 @@ gst_caps_intersect (const GstCaps * caps1, const GstCaps * caps2)
|
|||
|
||||
/* now run the diagonal line, end condition is the left or bottom
|
||||
* border */
|
||||
while (k < caps2->structs->len && j >= 0) {
|
||||
while (k < caps2->structs->len) {
|
||||
struct1 = gst_caps_get_structure (caps1, j);
|
||||
struct2 = gst_caps_get_structure (caps2, k);
|
||||
|
||||
|
@ -1009,6 +1010,8 @@ gst_caps_intersect (const GstCaps * caps1, const GstCaps * caps2)
|
|||
gst_caps_append_structure (dest, istruct);
|
||||
/* move down left */
|
||||
k++;
|
||||
if (j == 0)
|
||||
break; /* so we don't roll back to G_MAXUINT */
|
||||
j--;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2157,6 +2157,7 @@ gst_element_pads_activate (GstElement * element, gboolean active)
|
|||
GstIterator *iter;
|
||||
gboolean fold_ok;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "pads_activate with active %d", active);
|
||||
/* no need to unset this later, it's just a boolean */
|
||||
g_value_init (&ret, G_TYPE_BOOLEAN);
|
||||
g_value_set_boolean (&ret, TRUE);
|
||||
|
@ -2165,16 +2166,21 @@ gst_element_pads_activate (GstElement * element, gboolean active)
|
|||
fold_ok = iterator_fold_with_resync
|
||||
(iter, (GstIteratorFoldFunction) activate_pads, &ret, &active);
|
||||
gst_iterator_free (iter);
|
||||
if (!fold_ok || !g_value_get_boolean (&ret))
|
||||
if (!fold_ok || !g_value_get_boolean (&ret)) {
|
||||
GST_DEBUG_OBJECT (element, "pads_activate failed");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
iter = gst_element_iterate_sink_pads (element);
|
||||
fold_ok = iterator_fold_with_resync
|
||||
(iter, (GstIteratorFoldFunction) activate_pads, &ret, &active);
|
||||
gst_iterator_free (iter);
|
||||
if (!fold_ok || !g_value_get_boolean (&ret))
|
||||
if (!fold_ok || !g_value_get_boolean (&ret)) {
|
||||
GST_DEBUG_OBJECT (element, "pads_activate failed");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (element, "pads_activate successful");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -871,6 +871,7 @@ gst_object_set_parent (GstObject * object, GstObject * parent)
|
|||
* in the floating case. */
|
||||
object->parent = parent;
|
||||
if (G_LIKELY (GST_OBJECT_IS_FLOATING (object))) {
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_REFCOUNTING, object, "unsetting floating flag");
|
||||
GST_OBJECT_FLAG_UNSET (object, GST_OBJECT_FLOATING);
|
||||
GST_UNLOCK (object);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue