mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
elements: Use gst_pad_set_caps() and don't ignore its return value
This commit is contained in:
parent
aee0d2a2b3
commit
8d6ead8038
2 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue