[vlc-commits] sap: remove sdp_t.i_media_type

Rémi Denis-Courmont git at videolan.org
Fri Apr 10 12:18:27 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr 10 13:16:25 2020 +0300| [a5f0877f7583577a09a47d3804459150d6743d52] | committer: Rémi Denis-Courmont

sap: remove sdp_t.i_media_type

This was only written and read within ParseConnection().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5f0877f7583577a09a47d3804459150d6743d52
---

 modules/services_discovery/sap.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index c028fd6753..e80b9a4561 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -168,7 +168,6 @@ struct  sdp_t
     /* old cruft */
     /* "computed" URI */
     char *psz_uri;
-    int           i_media_type;
     unsigned rtcp_port;
 
     /* a= global attributes */
@@ -958,15 +957,15 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
         free (sdp_proto);
         return VLC_EGENERIC;
     }
-    else
+
+    *subtype++ = '\0';
+    /* FIXME: check for multiple payload types in RTP/AVP case.
+     * FIXME: check for "mpeg" subtype in raw udp case. */
+    if (strcasecmp(sdp_proto, "udp") != 0
+     && !IsWellKnownPayload(atoi(subtype)))
     {
-        *subtype++ = '\0';
-        /* FIXME: check for multiple payload types in RTP/AVP case.
-         * FIXME: check for "mpeg" subtype in raw udp case. */
-        if (!strcasecmp (sdp_proto, "udp"))
-            p_sdp->i_media_type = 33;
-        else
-            p_sdp->i_media_type = atoi (subtype);
+        free(sdp_proto);
+        return VLC_EGENERIC;
     }
 
     /* RTP protocol, nul, VLC shortcut, nul, flags byte as follow:
@@ -1081,12 +1080,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
             return VLC_ENOMEM;
     }
 
-    if (!IsWellKnownPayload(p_sdp->i_media_type))
-    {
-        free(p_sdp->psz_uri);
-        return VLC_EGENERIC;
-    }
-
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list