mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-08 18:39:54 +00:00
Boo!
Original commit message from CVS: 2005-10-31 Andy Wingo <wingo@pobox.com> * 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).
This commit is contained in:
parent
6f63540ea4
commit
4a9df820e3
4 changed files with 34 additions and 24 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2005-10-31 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* 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 <julien@moutte.net>
|
2005-10-28 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* gst/gstbus.c: Doc updates.
|
* gst/gstbus.c: Doc updates.
|
||||||
|
|
|
@ -575,7 +575,10 @@ gst_object_dispatch_properties_changed (GObject * object,
|
||||||
|
|
||||||
klass = GST_OBJECT_GET_CLASS (object);
|
klass = GST_OBJECT_GET_CLASS (object);
|
||||||
|
|
||||||
|
#ifndef GST_HAVE_GLIB_2_8
|
||||||
GST_CLASS_LOCK (klass);
|
GST_CLASS_LOCK (klass);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* do the standard dispatching */
|
/* do the standard dispatching */
|
||||||
PATCH_REFCOUNT (object);
|
PATCH_REFCOUNT (object);
|
||||||
G_OBJECT_CLASS (parent_class)->dispatch_properties_changed (object, n_pspecs,
|
G_OBJECT_CLASS (parent_class)->dispatch_properties_changed (object, n_pspecs,
|
||||||
|
@ -617,7 +620,10 @@ gst_object_dispatch_properties_changed (GObject * object,
|
||||||
gst_object_unref (old_parent);
|
gst_object_unref (old_parent);
|
||||||
}
|
}
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
|
||||||
|
#ifndef GST_HAVE_GLIB_2_8
|
||||||
GST_CLASS_UNLOCK (klass);
|
GST_CLASS_UNLOCK (klass);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -653,7 +653,8 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
||||||
"queue is full, leaking buffer on downstream end");
|
"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)) {
|
if (GST_IS_BUFFER (item->data)) {
|
||||||
leak = item->data;
|
leak = item->data;
|
||||||
break;
|
break;
|
||||||
|
@ -664,22 +665,17 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
* in here. That cannot happen, since we had >= 1 bufs */
|
* in here. That cannot happen, since we had >= 1 bufs */
|
||||||
g_assert (leak);
|
g_assert (leak);
|
||||||
|
|
||||||
/* Now remove it from the list, fixing up the GQueue
|
/* Now remove the link from the queue */
|
||||||
* CHECKME: is a queue->head the first or the last item? */
|
g_queue_delete_link (queue->queue, 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--;
|
|
||||||
|
|
||||||
/* and unref the buffer at the end. Twice, because we keep a ref
|
/* and unref the buffer at the end. Twice, because we keep a ref
|
||||||
* to make things read-only. Also keep our list uptodate. */
|
* 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--;
|
queue->cur_level.buffers--;
|
||||||
if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE)
|
if (GST_BUFFER_DURATION (leak) != GST_CLOCK_TIME_NONE)
|
||||||
queue->cur_level.time -= GST_BUFFER_DURATION (buffer);
|
queue->cur_level.time -= GST_BUFFER_DURATION (leak);
|
||||||
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (leak);
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -653,7 +653,8 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
||||||
"queue is full, leaking buffer on downstream end");
|
"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)) {
|
if (GST_IS_BUFFER (item->data)) {
|
||||||
leak = item->data;
|
leak = item->data;
|
||||||
break;
|
break;
|
||||||
|
@ -664,22 +665,17 @@ gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
* in here. That cannot happen, since we had >= 1 bufs */
|
* in here. That cannot happen, since we had >= 1 bufs */
|
||||||
g_assert (leak);
|
g_assert (leak);
|
||||||
|
|
||||||
/* Now remove it from the list, fixing up the GQueue
|
/* Now remove the link from the queue */
|
||||||
* CHECKME: is a queue->head the first or the last item? */
|
g_queue_delete_link (queue->queue, 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--;
|
|
||||||
|
|
||||||
/* and unref the buffer at the end. Twice, because we keep a ref
|
/* and unref the buffer at the end. Twice, because we keep a ref
|
||||||
* to make things read-only. Also keep our list uptodate. */
|
* 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--;
|
queue->cur_level.buffers--;
|
||||||
if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE)
|
if (GST_BUFFER_DURATION (leak) != GST_CLOCK_TIME_NONE)
|
||||||
queue->cur_level.time -= GST_BUFFER_DURATION (buffer);
|
queue->cur_level.time -= GST_BUFFER_DURATION (leak);
|
||||||
|
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (leak);
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue