From ceb705837d0f67760b38b72d3981d1bfeb1df69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 6 May 2020 11:44:39 +0300 Subject: [PATCH] discoverer: Ensure that we have fixed, non-empty caps before passing passing to is_subtitle_caps() Part-of: --- gst-libs/gst/pbutils/gstdiscoverer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index 7dfd7eeefb..b27f89a2a9 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -712,7 +712,8 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad, if (sinkpad == NULL) goto error; - if (is_subtitle_caps (caps)) { + 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 * wait for data to preroll */ ps->probe_id = @@ -722,7 +723,8 @@ uridecodebin_pad_added_cb (GstElement * uridecodebin, GstPad * pad, dc->priv->pending_subtitle_pads++; } - gst_caps_unref (caps); + if (caps) + gst_caps_unref (caps); gst_bin_add_many (dc->priv->pipeline, ps->queue, ps->sink, NULL);