mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
discoverer: Check sinkpad existence before retrieving caps
Otherwise we would error out without releasing the caps first. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/655>
This commit is contained in:
parent
ceb705837d
commit
47e2c4cc10
1 changed files with 4 additions and 4 deletions
|
@ -701,6 +701,10 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
|
||||||
g_object_set (ps->sink, "silent", TRUE, NULL);
|
g_object_set (ps->sink, "silent", TRUE, NULL);
|
||||||
g_object_set (ps->queue, "max-size-buffers", 1, "silent", TRUE, NULL);
|
g_object_set (ps->queue, "max-size-buffers", 1, "silent", TRUE, NULL);
|
||||||
|
|
||||||
|
sinkpad = gst_element_get_static_pad (ps->queue, "sink");
|
||||||
|
if (sinkpad == NULL)
|
||||||
|
goto error;
|
||||||
|
|
||||||
caps = gst_pad_get_current_caps (pad);
|
caps = gst_pad_get_current_caps (pad);
|
||||||
if (!caps) {
|
if (!caps) {
|
||||||
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
|
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
|
||||||
|
@ -708,10 +712,6 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
|
||||||
caps = gst_pad_query_caps (pad, NULL);
|
caps = gst_pad_query_caps (pad, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
sinkpad = gst_element_get_static_pad (ps->queue, "sink");
|
|
||||||
if (sinkpad == NULL)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (caps && !gst_caps_is_empty (caps) && !gst_caps_is_any (caps)
|
if (caps && !gst_caps_is_empty (caps) && !gst_caps_is_any (caps)
|
||||||
&& is_subtitle_caps (caps)) {
|
&& is_subtitle_caps (caps)) {
|
||||||
/* Subtitle streams are sparse and may not provide any information - don't
|
/* Subtitle streams are sparse and may not provide any information - don't
|
||||||
|
|
Loading…
Reference in a new issue