[FFmpeg-cvslog] rtsp: Parse the mode=receive/record parameter in transport lines

Jordi Ortiz git at videolan.org
Thu Jul 12 00:03:05 CEST 2012


ffmpeg | branch: master | Jordi Ortiz <nenjordi at gmail.com> | Tue Jul 10 19:21:58 2012 +0200| [45b068580b8c7d65a4422b47f2b98b258cf9587b] | committer: Martin Storsjö

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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=45b068580b8c7d65a4422b47f2b98b258cf9587b
---

 libavformat/rtsp.c |    8 ++++++++
 libavformat/rtsp.h |    3 +++
 2 files changed, 11 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 76b5df8..551884b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -749,6 +749,14 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
                     get_word_sep(buf, sizeof(buf), ";,", &p);
                     av_strlcpy(th->source, buf, sizeof(th->source));
                 }
+            } else if (!strcmp(parameter, "mode")) {
+                if (*p == '=') {
+                    p++;
+                    get_word_sep(buf, sizeof(buf), ";, ", &p);
+                    if (!strcmp(buf, "record") ||
+                        !strcmp(buf, "receive"))
+                        th->mode_record = 1;
+                }
             }
 
             while (*p != ';' && *p != '\0' && *p != ',')
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index e512336..55743b5 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -102,6 +102,9 @@ typedef struct RTSPTransportField {
      * packets will be allowed to make before being discarded. */
     int ttl;
 
+    /** transport set to record data */
+    int mode_record;
+
     struct sockaddr_storage destination; /**< destination IP address */
     char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */
 



More information about the ffmpeg-cvslog mailing list