diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c index b4ec24f23..1c63013bd 100644 --- a/src/gst/gstpipewireformat.c +++ b/src/gst/gstpipewireformat.c @@ -1209,10 +1209,11 @@ filter_dmabuf_caps (GstCapsFeatures *features, return TRUE; } -GstCaps * -gst_caps_sanitize (GstCaps *caps) +void +gst_caps_sanitize (GstCaps **caps) { - caps = gst_caps_make_writable (caps); - gst_caps_filter_and_map_in_place (caps, filter_dmabuf_caps, NULL); - return caps; + g_return_if_fail (GST_IS_CAPS (*caps)); + + *caps = gst_caps_make_writable (*caps); + gst_caps_filter_and_map_in_place (*caps, filter_dmabuf_caps, NULL); } diff --git a/src/gst/gstpipewireformat.h b/src/gst/gstpipewireformat.h index ca76b70c2..1c3a239ba 100644 --- a/src/gst/gstpipewireformat.h +++ b/src/gst/gstpipewireformat.h @@ -15,7 +15,7 @@ GPtrArray * gst_caps_to_format_all (GstCaps *caps); GstCaps * gst_caps_from_format (const struct spa_pod *format); -GstCaps * gst_caps_sanitize (GstCaps *caps); +void gst_caps_sanitize (GstCaps **caps); G_END_DECLS diff --git a/src/gst/gstpipewiresrc.c b/src/gst/gstpipewiresrc.c index b8e1a271f..dd7b942cd 100644 --- a/src/gst/gstpipewiresrc.c +++ b/src/gst/gstpipewiresrc.c @@ -846,9 +846,9 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc) } GST_DEBUG_OBJECT (basesrc, "have common caps: %" GST_PTR_FORMAT, caps); - gst_caps_sanitize (caps); + gst_caps_sanitize (&caps); - if (caps == NULL || gst_caps_is_empty (caps)) + if (gst_caps_is_empty (caps)) goto no_common_caps; GST_DEBUG_OBJECT (basesrc, "have common caps (sanitized): %" GST_PTR_FORMAT, caps);