summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-05-06 11:52:20 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-25 00:21:27 +0000
commit88dff5ddbb14beb3fb58c77fed46b5db95da05b5 (patch)
treed9712a9f551396dbeefdd8c5d8b0d3860ca1a48a
parent41db7f8ce167138a253b32ea5bf6b78382316998 (diff)
downloadgstreamer-plugins-base-88dff5ddbb14beb3fb58c77fed46b5db95da05b5.tar.gz
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/825>
-rw-r--r--gst-libs/gst/pbutils/gstdiscoverer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index 82052f719..ea4b00919 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -702,6 +702,10 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
g_object_set (ps->sink, "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);
if (!caps) {
GST_WARNING ("Couldn't get negotiated caps from %s:%s",
@@ -709,10 +713,6 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad,
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)
&& is_subtitle_caps (caps)) {
/* Subtitle streams are sparse and may not provide any information - don't