From 8442bbf6669b9c3a4e41ddef6779a1cba36ec592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 4 Apr 2023 19:23:14 +0300 Subject: rtspsrc: Skip PTs with caps incompatible to the global caps Otherwise empty caps are created while all following code assumes that the caps will have exactly one structure, and then run into assertions. Part-of: --- subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c index 6526ef54cd..e459d01bf1 100644 --- a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c +++ b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c @@ -2251,6 +2251,13 @@ gst_rtspsrc_collect_payloads (GstRTSPSrc * src, const GstSDPMessage * sdp, outcaps = gst_caps_intersect (caps, global_caps); gst_caps_unref (caps); + if (gst_caps_is_empty (outcaps)) { + GST_WARNING_OBJECT (src, + " skipping pt %d with caps conflicting with the global caps", pt); + gst_caps_unref (outcaps); + continue; + } + /* the first pt will be the default */ if (stream->ptmap->len == 0) stream->default_pt = pt; -- cgit v1.2.1