summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-04-04 19:23:14 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-05-06 23:20:03 +0000
commit8442bbf6669b9c3a4e41ddef6779a1cba36ec592 (patch)
treed626e07d12be08a4efe53ff09e9980c0009452c7
parenta74bf2a45eaabf4e1e01ed1888dcbe6150b6c8d1 (diff)
downloadgstreamer-1.20.tar.gz
rtspsrc: Skip PTs with caps incompatible to the global caps1.20
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4568>
-rw-r--r--subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c7
1 files changed, 7 insertions, 0 deletions
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;