decodebin3: Properly handle caps query with no filter
authorEdward Hervey <edward@centricular.com>
Sat, 14 Nov 2020 08:43:59 +0000 (09:43 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 19 Nov 2020 10:05:03 +0000 (11:05 +0100)
There's no guarantee that upstream elements will do queries with specified
filter caps. If that's the case, just return GST_CAPS_ANY

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/933>

gst/playback/gstdecodebin3-parse.c

index aea0f66..1c23d0d 100644 (file)
@@ -145,6 +145,10 @@ get_parser_caps_filter (GstDecodebin3 * dbin, GstCaps * caps)
   GList *tmp;
   GstCaps *filter_caps = gst_caps_new_empty ();
 
+  /* If no filter was provided, it can handle anything */
+  if (!caps || gst_caps_is_any (caps))
+    return gst_caps_new_any ();
+
   g_mutex_lock (&dbin->factories_lock);
   gst_decode_bin_update_factories_list (dbin);
   for (tmp = dbin->decoder_factories; tmp; tmp = tmp->next) {