[vlc-commits] livehttp: parse key="value" style options

Ilkka Ollakka git at videolan.org
Thu Dec 12 08:53:42 CET 2013


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Dec 11 09:03:22 2013 +0200| [b9a080559f0e0491e459fe16a07540eb708e056b] | committer: Ilkka Ollakka

livehttp: parse key="value" style options

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

 modules/stream_filter/httplive.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index c449579..050d782 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -496,9 +496,21 @@ static char *parse_Attributes(const char *line, const char *attr)
         if (strncasecmp(begin, attr, strlen(attr)) == 0
           && begin[strlen(attr)] == '=')
         {
-            /* <attr>=<value>[,]* */
+            /* <attr>="<value>"[,]* */
             p = strchr(begin, ',');
             begin += strlen(attr) + 1;
+
+            /* Check if we have " " marked value*/
+            if( begin[0] == '"' )
+            {
+                char *valueend = strchr( begin+1, '"');
+
+                /* No ending " so bail out */
+                if( unlikely( !valueend ) )
+                    return NULL;
+
+                p = strchr( valueend, ',');
+            }
             if (begin >= end)
                 return NULL;
             if (p == NULL) /* last attribute */



More information about the vlc-commits mailing list