+2004-11-24 Martin Soto <martinsoto@users.sourceforge.net>
+
+ * gst/gstqueue.c (gst_queue_link_sink): Grab the lock only when
+ it is necessary to wait.
+
2004-11-24 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* docs/pwg/building-boiler.xml:
queue = GST_QUEUE (gst_pad_get_parent (pad));
- GST_QUEUE_MUTEX_LOCK;
-
if (queue->cur_level.bytes > 0) {
if (gst_caps_is_equal (caps, queue->negotiated_caps)) {
GST_QUEUE_MUTEX_UNLOCK;
/* Wait until the queue is empty before attempting the pad
negotiation. */
+ GST_QUEUE_MUTEX_LOCK;
+
STATUS (queue, "waiting for queue to get empty");
while (queue->cur_level.bytes > 0) {
g_cond_wait (queue->item_del, queue->qlock);
}
STATUS (queue, "queue is now empty");
+
+ GST_QUEUE_MUTEX_UNLOCK;
}
link_ret = gst_pad_proxy_pad_link (pad, caps);
gst_caps_replace (&queue->negotiated_caps, gst_caps_copy (caps));
}
- GST_QUEUE_MUTEX_UNLOCK;
-
return link_ret;
}
queue = GST_QUEUE (gst_pad_get_parent (pad));
- GST_QUEUE_MUTEX_LOCK;
-
if (queue->cur_level.bytes > 0) {
if (gst_caps_is_equal (caps, queue->negotiated_caps)) {
GST_QUEUE_MUTEX_UNLOCK;
/* Wait until the queue is empty before attempting the pad
negotiation. */
+ GST_QUEUE_MUTEX_LOCK;
+
STATUS (queue, "waiting for queue to get empty");
while (queue->cur_level.bytes > 0) {
g_cond_wait (queue->item_del, queue->qlock);
}
STATUS (queue, "queue is now empty");
+
+ GST_QUEUE_MUTEX_UNLOCK;
}
link_ret = gst_pad_proxy_pad_link (pad, caps);
gst_caps_replace (&queue->negotiated_caps, gst_caps_copy (caps));
}
- GST_QUEUE_MUTEX_UNLOCK;
-
return link_ret;
}