summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.d@gmail.com>2008-11-18 16:52:11 +0000
committerAlessandro Decina <alessandro.d@gmail.com>2008-11-18 16:52:11 +0000
commita49918b152aa7b0e998e0f159d4b0128c297c347 (patch)
tree90cb2d74c61e1cb27ffc19274c11ef1645dbda7d /ext
parent6edbddd2d9cd98b568071c1766e5cb7a0a2be836 (diff)
downloadgst-plugins-bad-a49918b152aa7b0e998e0f159d4b0128c297c347.tar.gz
gst-plugins-bad-a49918b152aa7b0e998e0f159d4b0128c297c347.tar.bz2
gst-plugins-bad-a49918b152aa7b0e998e0f159d4b0128c297c347.zip
ext/metadata/gstbasemetadata.c: Avoid deadlock during pad activation.
Original commit message from CVS: * ext/metadata/gstbasemetadata.c: Avoid deadlock during pad activation. Fixes #561241.
Diffstat (limited to 'ext')
-rw-r--r--ext/metadata/gstbasemetadata.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/ext/metadata/gstbasemetadata.c b/ext/metadata/gstbasemetadata.c
index e86c9ce1..0e4eb512 100644
--- a/ext/metadata/gstbasemetadata.c
+++ b/ext/metadata/gstbasemetadata.c
@@ -1807,16 +1807,24 @@ gst_base_metadata_sink_activate (GstPad * pad)
}
if (ret) {
- gst_pad_activate_pull (pad, FALSE);
- gst_pad_activate_push (filter->srcpad, FALSE);
- if (!gst_pad_is_active (pad)) {
- ret = gst_pad_activate_push (filter->srcpad, TRUE);
- ret = ret && gst_pad_activate_push (pad, TRUE);
+ GstActivateMode mode;
+
+ /* in gst_base_metadata_pull_range_parse() we could have triggered
+ * negotiation and plugged new downstream elements.
+ * If GST_PAD_ACTIVATE_MODE (filter->srcpad) is GST_ACTIVATE_PULL it means
+ * that downstream is active in pull mode so we don't deactivate pull mode.
+ */
+ GST_OBJECT_LOCK (filter->srcpad);
+ mode = GST_PAD_ACTIVATE_MODE (filter->srcpad);
+ GST_OBJECT_UNLOCK (filter->srcpad);
+
+ if (mode != GST_ACTIVATE_PULL) {
+ /* change from PULL to PUSH */
+ gst_pad_activate_push (pad, TRUE);
}
}
return ret;
-
}
static gboolean