[1/2] rtsp: Parse the x-Accept-Dynamic-Rate header

Message ID 1318373243-14306-1-git-send-email-martin@martin.st
State Committed
Commit 30eae325302a99fd6c3051c34b60a605765e026c
Headers show

Commit Message

Martin Storsjö Oct. 11, 2011, 10:47 p.m.
---
 libavformat/rtsp.c |    3 +++
 libavformat/rtsp.h |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 8b70c8b..2c0b0f7 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -808,6 +808,9 @@  void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
         if (strstr(p, "GET_PARAMETER") &&
             method && !strcmp(method, "OPTIONS"))
             rt->get_parameter_supported = 1;
+    } else if (av_stristart(p, "x-Accept-Dynamic-Rate:", &p) && rt) {
+        p += strspn(p, SPACE_CHARS);
+        rt->accept_dynamic_rate = atoi(p);
     }
 }
 
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 265d9f8..62ca483 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -346,6 +346,9 @@  typedef struct RTSPState {
      * Option flags for the chained RTP muxer.
      */
     int rtp_muxer_flags;
+
+    /** Whether the server accepts the x-Dynamic-Rate header */
+    int accept_dynamic_rate;
 } RTSPState;
 
 /**