From: <wi...@fr...> - 2005-10-31 09:52:28
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wingo Date: Mon Oct 31 2005 01:52:25 PST Log message: 2005-10-31 Andy Wingo <wi...@po...> * Boo! * gst/gstqueue.c (gst_queue_chain): Fix downstream leaky mode. * gst/gstobject.c (gst_object_dispatch_properties_changed): No need to serialize property notifications on GLib 2.8. GLib 2.6 has the possibility of deadlocks here if code calling notify() or set() has a lock that can be taken in another notify handler (ABBA with class lock and e.g. python GIL state lock). Modified files: . : ChangeLog gst : gstobject.c gstqueue.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1806&r2=1.1807 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstobject.c.diff?r1=1.107&r2=1.108 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstqueue.c.diff?r1=1.157&r2=1.158 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1806 retrieving revision 1.1807 diff -u -d -r1.1806 -r1.1807 --- ChangeLog 28 Oct 2005 18:18:23 -0000 1.1806 +++ ChangeLog 31 Oct 2005 09:52:13 -0000 1.1807 @@ -1,3 +1,15 @@ +2005-10-31 Andy Wingo <wi...@po...> + + * Boo! + * gst/gstqueue.c (gst_queue_chain): Fix downstream leaky mode. + * gst/gstobject.c (gst_object_dispatch_properties_changed): No + need to serialize property notifications on GLib 2.8. GLib 2.6 has + the possibility of deadlocks here if code calling notify() or + set() has a lock that can be taken in another notify handler (ABBA + with class lock and e.g. python GIL state lock). 2005-10-28 Julien MOUTTE <ju...@mo...> * gst/gstbus.c: Doc updates. Index: gstobject.c RCS file: /cvs/gstreamer/gstreamer/gst/gstobject.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- gstobject.c 17 Oct 2005 14:37:06 -0000 1.107 +++ gstobject.c 31 Oct 2005 09:52:13 -0000 1.108 @@ -575,7 +575,10 @@ klass = GST_OBJECT_GET_CLASS (object); +#ifndef GST_HAVE_GLIB_2_8 GST_CLASS_LOCK (klass); +#endif /* do the standard dispatching */ PATCH_REFCOUNT (object); G_OBJECT_CLASS (parent_class)->dispatch_properties_changed (object, n_pspecs, @@ -617,7 +620,10 @@ gst_object_unref (old_parent); } g_free (name); GST_CLASS_UNLOCK (klass); } /** Index: gstqueue.c RCS file: /cvs/gstreamer/gstreamer/gst/gstqueue.c,v retrieving revision 1.157 retrieving revision 1.158 diff -u -d -r1.157 -r1.158 --- gstqueue.c 28 Oct 2005 10:45:33 -0000 1.157 +++ gstqueue.c 31 Oct 2005 09:52:13 -0000 1.158 @@ -653,7 +653,8 @@ GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "queue is full, leaking buffer on downstream end"); - for (item = queue->queue->head; item != NULL; item = item->next) { + for (item = g_queue_peek_head_link (queue->queue); item; + item = item->next) { if (GST_IS_BUFFER (item->data)) { leak = item->data; break; @@ -664,22 +665,17 @@ * in here. That cannot happen, since we had >= 1 bufs */ g_assert (leak); - /* Now remove it from the list, fixing up the GQueue - * CHECKME: is a queue->head the first or the last item? */ - item = g_list_delete_link (queue->queue->head, item); - queue->queue->head = g_list_first (item); - queue->queue->tail = g_list_last (item); - queue->queue->length--; + /* Now remove the link from the queue */ + g_queue_delete_link (queue->queue, item); /* and unref the buffer at the end. Twice, because we keep a ref * to make things read-only. Also keep our list uptodate. */ - queue->cur_level.bytes -= GST_BUFFER_SIZE (buffer); + queue->cur_level.bytes -= GST_BUFFER_SIZE (leak); queue->cur_level.buffers--; - if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE) - queue->cur_level.time -= GST_BUFFER_DURATION (buffer); + if (GST_BUFFER_DURATION (leak) != GST_CLOCK_TIME_NONE) + queue->cur_level.time -= GST_BUFFER_DURATION (leak); - gst_buffer_unref (buffer); + gst_buffer_unref (leak); break; } |