[gst-devel] patch gstprops.c

Jim Thornton jthornton at parc.com
Fri Mar 22 19:11:02 CET 2002


Two changes here:
- slight change to some debug output, you might not like it, not a big 
deal either way
- bugfix for intersecting int list with int range: the proper intersection 
should be those ints in the list that lie within the range (rather than an 
empty intersection).  This is a fix for one spot, though there's probably 
a symmetric spot that also needs to be fixed.  Didn't look for that.  Hope 
this is the right idiom for appending to a list.

--- gstprops.c.orig	Thu Mar 21 15:33:02 2002
+++ gstprops.c	Thu Mar 21 17:03:17 2002
@@ -81,7 +81,7 @@
 		      entry->data.float_range_data.max);
       break;
     case GST_PROPS_LIST_ID:
-      GST_DEBUG (GST_CAT_PROPERTIES, "[list]\n");
+      GST_DEBUG (GST_CAT_PROPERTIES, "%s: [list]\n", name);
       {
 	GList *entries = entry->data.list_data.entries;
 
@@ -1150,6 +1150,29 @@
 	      entry1->data.int_range_data.max >= entry2->data.int_data) {
             result = gst_props_entry_copy (entry2);
 	  }
+	  break;
+        case GST_PROPS_LIST_ID: 
+	{
+	  GList *entries = entry2->data.list_data.entries;
+	  result = gst_props_alloc_entry ();
+	  result->propid = entry1->propid;
+	  result->propstype = GST_PROPS_LIST_ID;
+	  result->data.list_data.entries = NULL;
+	  while (entries) {
+	    GstPropsEntry * this = (GstPropsEntry *)entries->data;
+	    if (this->propstype != GST_PROPS_INT_ID) {
+	      // no hope, this list doesn't even contain ints!
+	      result = NULL;
+	      break;
+	    }
+	    if (this->data.int_data >= entry1->data.int_range_data.min &&
+		this->data.int_data <= entry1->data.int_range_data.max) {
+	      result->data.list_data.entries = 
g_list_append(result->data.list_data.entries, gst_props_entry_copy(this));
+	    }
+	    entries = g_list_next (entries);
+	  }
+	  break;
+	}
         default:
 	  break;
       }






More information about the gstreamer-devel mailing list