diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-05-06 11:42:05 +0300 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-09-25 00:21:27 +0000 |
commit | b6d2dfb3f8f8527973dda38a5ebe263f5c9d62db (patch) | |
tree | ed7c44229f8d34b0340a37927c00b640469174b8 | |
parent | 9e6935ebd528f5e139862a1aee10789e83915339 (diff) | |
download | gstreamer-plugins-base-b6d2dfb3f8f8527973dda38a5ebe263f5c9d62db.tar.gz |
discoverer: Try to get negotiated caps first on pad-added and only then fall back to a caps query
The negotiated caps will be more accurate and are fixed caps in any
case.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/498
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/825>
-rw-r--r-- | gst-libs/gst/pbutils/gstdiscoverer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst-libs/gst/pbutils/gstdiscoverer.c b/gst-libs/gst/pbutils/gstdiscoverer.c index f14bc1313..1428fd278 100644 --- a/gst-libs/gst/pbutils/gstdiscoverer.c +++ b/gst-libs/gst/pbutils/gstdiscoverer.c @@ -702,7 +702,12 @@ 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); - caps = gst_pad_query_caps (pad, NULL); + caps = gst_pad_get_current_caps (pad); + if (!caps) { + GST_WARNING ("Couldn't get negotiated caps from %s:%s", + GST_DEBUG_PAD_NAME (pad)); + caps = gst_pad_query_caps (pad, NULL); + } sinkpad = gst_element_get_static_pad (ps->queue, "sink"); if (sinkpad == NULL) |