summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-05-06 11:44:39 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-25 00:21:27 +0000
commit41db7f8ce167138a253b32ea5bf6b78382316998 (patch)
tree658af888a6f04b5dd44e4fe0dd9aef9cb70045e3
parentb6d2dfb3f8f8527973dda38a5ebe263f5c9d62db (diff)
downloadgstreamer-plugins-base-41db7f8ce167138a253b32ea5bf6b78382316998.tar.gz
discoverer: Ensure that we have fixed, non-empty caps before passing passing to is_subtitle_caps()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/825>
-rw-r--r--gst-libs/gst/pbutils/gstdiscoverer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c
index 1428fd278..82052f719 100644
--- a/gst-libs/gst/pbutils/gstdiscoverer.c
+++ b/gst-libs/gst/pbutils/gstdiscoverer.c
@@ -713,7 +713,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 =
@@ -723,7 +724,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);