Browse code

rtsp: Parse the mode=receive/record parameter in transport lines

We need to support the nonstandard mode=receive, for compatibility
with older libavformat clients.

Signed-off-by: Martin Storsjö <martin@martin.st>

Jordi Ortiz authored on 2012/07/11 02:21:58
Showing 2 changed files
... ...
@@ -749,6 +749,14 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
749 749
                     get_word_sep(buf, sizeof(buf), ";,", &p);
750 750
                     av_strlcpy(th->source, buf, sizeof(th->source));
751 751
                 }
752
+            } else if (!strcmp(parameter, "mode")) {
753
+                if (*p == '=') {
754
+                    p++;
755
+                    get_word_sep(buf, sizeof(buf), ";, ", &p);
756
+                    if (!strcmp(buf, "record") ||
757
+                        !strcmp(buf, "receive"))
758
+                        th->mode_record = 1;
759
+                }
752 760
             }
753 761
 
754 762
             while (*p != ';' && *p != '\0' && *p != ',')
... ...
@@ -102,6 +102,9 @@ typedef struct RTSPTransportField {
102 102
      * packets will be allowed to make before being discarded. */
103 103
     int ttl;
104 104
 
105
+    /** transport set to record data */
106
+    int mode_record;
107
+
105 108
     struct sockaddr_storage destination; /**< destination IP address */
106 109
     char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */
107 110