From 8d6ead8038b90492863135dfabe6a8a58d523e2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 8 Jun 2012 15:45:38 +0200 Subject: [PATCH] elements: Use gst_pad_set_caps() and don't ignore its return value --- plugins/elements/gstcapsfilter.c | 3 ++- plugins/elements/gsttypefindelement.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 971cb7f..1c585d9 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -305,7 +305,8 @@ gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input, GST_PTR_FORMAT " to apply to srcpad", out_caps); if (!gst_pad_has_current_caps (trans->srcpad)) - gst_pad_push_event (trans->srcpad, gst_event_new_caps (out_caps)); + if (!gst_pad_set_caps (trans->srcpad, out_caps)) + ret = GST_FLOW_NOT_NEGOTIATED; gst_caps_unref (out_caps); } else { gchar *caps_str = gst_caps_to_string (out_caps); diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index e6c4de2..2bc5699 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -188,7 +188,7 @@ gst_type_find_element_have_type (GstTypeFindElement * typefind, typefind->caps = gst_caps_ref (caps); GST_OBJECT_UNLOCK (typefind); - gst_pad_push_event (typefind->src, gst_event_new_caps (caps)); + gst_pad_set_caps (typefind->src, caps); } static void @@ -979,12 +979,12 @@ gst_type_find_element_activate_src_mode (GstPad * pad, GstObject * parent, * activation might happen from the streaming thread. */ gst_pad_pause_task (typefind->sink); res = gst_pad_activate_mode (typefind->sink, mode, active); - if (typefind->caps) { + if (res && typefind->caps) { GstCaps *caps; GST_OBJECT_LOCK (typefind); caps = gst_caps_ref (typefind->caps); GST_OBJECT_UNLOCK (typefind); - gst_pad_push_event (typefind->src, gst_event_new_caps (caps)); + res = gst_pad_set_caps (typefind->src, caps); gst_caps_unref (caps); } break; -- 2.7.4