[vlc-commits] sap: don't retain unused origin info

Rémi Denis-Courmont git at videolan.org
Sat Apr 4 19:44:06 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr  4 20:35:32 2020 +0300| [051bf8f23d42c564f042648d1d35023acf7ec89f] | committer: Rémi Denis-Courmont

sap: don't retain unused origin info

We really don't care about the origin, except for the username (and
even then, only because it's included in the input item custom meta).

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

 modules/services_discovery/sap.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index 018ecf436a..232b0d448b 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -158,10 +158,6 @@ struct  sdp_t
 
     /* o field */
     char     username[64];
-    uint64_t session_id;
-    uint64_t session_version;
-    unsigned orig_ip_version;
-    char     orig_host[1024];
 
     /* s= field */
     char *psz_sessionname;
@@ -1241,18 +1237,13 @@ static sdp_t *ParseSDP (vlc_object_t *p_obj, const char *psz_sdp)
                     goto error;
                 }
 
-                if ((sscanf (data, "%63s %"SCNu64" %"SCNu64" IN IP%u %1023s",
-                             p_sdp->username, &p_sdp->session_id,
-                             &p_sdp->session_version, &p_sdp->orig_ip_version,
-                             p_sdp->orig_host) != 5)
-                 || ((p_sdp->orig_ip_version != 4)
-                  && (p_sdp->orig_ip_version != 6)))
+                if (sscanf(data, "%63s %*u %*u IN %*s %*s%n",
+                           p_sdp->username, &(int){ 0 }) != 2)
                 {
                     msg_Dbg (p_obj, "SDP origin not supported: %s", data);
                     /* Or maybe out-of-range, but this looks suspicious */
                     goto error;
                 }
-                EnsureUTF8 (p_sdp->orig_host);
                 break;
 
             case 'S':



More information about the vlc-commits mailing list