mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-23 17:14:23 +00:00
decodebin: Don't unref caps for which we don't own a reference... get one first
https://bugzilla.gnome.org/show_bug.cgi?id=733615
This commit is contained in:
parent
73646bd04f
commit
f173fa15b1
1 changed files with 13 additions and 2 deletions
|
@ -1536,6 +1536,12 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
|
||||||
group->no_more_pads = TRUE;
|
group->no_more_pads = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* From here on we own a reference to the caps as
|
||||||
|
* we might create new caps below and would need
|
||||||
|
* to unref them later */
|
||||||
|
if (caps)
|
||||||
|
gst_caps_ref (caps);
|
||||||
|
|
||||||
if ((caps == NULL) || gst_caps_is_empty (caps))
|
if ((caps == NULL) || gst_caps_is_empty (caps))
|
||||||
goto unknown_type;
|
goto unknown_type;
|
||||||
|
|
||||||
|
@ -1765,6 +1771,8 @@ analyze_new_pad (GstDecodeBin * dbin, GstElement * src, GstPad * pad,
|
||||||
if (!res)
|
if (!res)
|
||||||
goto unknown_type;
|
goto unknown_type;
|
||||||
|
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
expose_pad:
|
expose_pad:
|
||||||
|
@ -1772,6 +1780,7 @@ expose_pad:
|
||||||
GST_LOG_OBJECT (dbin, "Pad is final. autoplug-continue:%d", apcontinue);
|
GST_LOG_OBJECT (dbin, "Pad is final. autoplug-continue:%d", apcontinue);
|
||||||
expose_pad (dbin, src, dpad, pad, caps, chain);
|
expose_pad (dbin, src, dpad, pad, caps, chain);
|
||||||
gst_object_unref (dpad);
|
gst_object_unref (dpad);
|
||||||
|
gst_caps_unref (caps);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1779,7 +1788,7 @@ discarded_type:
|
||||||
{
|
{
|
||||||
GST_LOG_OBJECT (pad, "Known type, but discarded because not final caps");
|
GST_LOG_OBJECT (pad, "Known type, but discarded because not final caps");
|
||||||
chain->deadend = TRUE;
|
chain->deadend = TRUE;
|
||||||
chain->endcaps = gst_caps_ref (caps);
|
chain->endcaps = caps;
|
||||||
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
|
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
|
||||||
|
|
||||||
/* Try to expose anything */
|
/* Try to expose anything */
|
||||||
|
@ -1798,7 +1807,7 @@ unknown_type:
|
||||||
GST_LOG_OBJECT (pad, "Unknown type, posting message and firing signal");
|
GST_LOG_OBJECT (pad, "Unknown type, posting message and firing signal");
|
||||||
|
|
||||||
chain->deadend = TRUE;
|
chain->deadend = TRUE;
|
||||||
chain->endcaps = gst_caps_ref (caps);
|
chain->endcaps = caps;
|
||||||
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
|
gst_object_replace ((GstObject **) & chain->current_pad, NULL);
|
||||||
|
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (dbin),
|
gst_element_post_message (GST_ELEMENT_CAST (dbin),
|
||||||
|
@ -1868,6 +1877,8 @@ setup_caps_delay:
|
||||||
* we have to unref the pad */
|
* we have to unref the pad */
|
||||||
if (is_parser_converter)
|
if (is_parser_converter)
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
|
if (caps)
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue