sdpmessage: Parse zero clock-rate as default
authorOlivier Crête <olivier.crete@collabora.com>
Wed, 9 Aug 2023 21:35:39 +0000 (17:35 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 18 Aug 2023 11:43:28 +0000 (12:43 +0100)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5199>

subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c

index b62101302f1156bcbe3058fa9ee3863e72b4f595..c4dde757e9635bff0feae4fbe34b4173e5d38176 100644 (file)
@@ -3614,7 +3614,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)) {