How to set and get user_data for GstBuffer?

Hunter zhangyanping210 at yahoo.com.cn
Mon Mar 11 02:50:56 PDT 2013


Hello Wim,

      I found gst_mini_object_get_qdata has a small bug.

      If gst_mini_object_set_qdata is not called, then you call
gst_mini_object_get_qdata will cause segment failed.

      The reason is:

      #0  0x2ab3ec40 in find_notify (object=0x112800, quark=1458,
match_notify=0, notify=0, data=0x0) at gstminiobject.c:387
#1  0x2ab3fd00 in gst_mini_object_get_qdata (object=0x112800, quark=1458) at
gstminiobject.c:726

17818 find_notify (GstMiniObject * object, GQuark quark, gboolean
match_notify,
17819     GstMiniObjectNotify notify, gpointer data)
17820 {
17821   guint i;
17822
17823   for (i = 0; i < object->n_qdata; i++) {
17824     if ((((GstQData *)(object)->qdata)[(i)].quark) == quark) {
17825
17826       if (!match_notify || ((((GstQData
*)(object)->qdata)[(i)].notify) == notify &&
17827               (((GstQData *)(object)->qdata)[(i)].data) == data))
17828         return i;
17829     }
17830   }
17831   return -1;
17832 }

   at line 17824, (object)->qdata is NULL.


   So I think find_notify should handle NULL  (object)->qdata here.

   Thanks.







--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-set-and-get-user-data-for-GstBuffer-tp4659031p4659034.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list