pulsesink: Deal with not being able to convert a format to caps
authorArun Raghavan <arunsr@codeaurora.org>
Wed, 6 Feb 2019 09:13:18 +0000 (14:43 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Wed, 6 Feb 2019 10:03:31 +0000 (15:33 +0530)
It is possible that PulseAudio adds formats that are not yet supported
in pulsesink, and in those cases, we want to gracefully skip them rather
than cause an assert on a NULL caps.

ext/pulse/pulsesink.c

index 42330a4..ca75915 100644 (file)
@@ -2183,8 +2183,9 @@ gst_pulsesink_query_getcaps (GstPulseSink * psink, GstCaps * filter)
   }
 
   for (i = g_list_first (device_info.formats); i; i = g_list_next (i)) {
-    gst_caps_append (ret,
-        gst_pulse_format_info_to_caps ((pa_format_info *) i->data));
+    GstCaps *caps = gst_pulse_format_info_to_caps ((pa_format_info *) i->data);
+    if (caps)
+      gst_caps_append (ret, caps);
   }
 
 unlock: