From f3cd913b3cb06b43b6ebe6be9c7ed6bfc03e1fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 9 Aug 2023 17:35:39 -0400 Subject: [PATCH] sdpmessage: Parse zero clock-rate as default It seems there is at least one broken RTSP server out there that returns a clock-rate of 0. Let's just ignore it and use the default in that case. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c index 2e17e7c596..0ef3dab456 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c @@ -3641,7 +3641,9 @@ gst_sdp_media_get_caps_from_media (const GstSDPMedia * media, gint pt) /* check if we have a rate, if not, we need to look up the rate from the * default rates based on the payload types. */ - if (rate == -1) { + /* Some broken RTSP server puts a rate of 0, also use the default in that + * case */ + if (rate <= 0) { const GstRTPPayloadInfo *info; if (GST_RTP_PAYLOAD_IS_DYNAMIC (pt)) {