summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-01-02 10:07:56 +0000
committerMartin Storsjö <martin@martin.st>2011-01-02 10:07:56 +0000
commitacc9ed14507c8a25c6ba633065311ceafb09e8e0 (patch)
tree2194461f7de5b595db978789f6d63179d1be6750
parent3df54c6bf2e5bc03b2dedcd60006d8f1df204ea3 (diff)
rtsp: Pass RTSPState to ff_rtsp_parse_line, instead of HTTPAuthState
This allows ff_rtsp_parse_line to do more changes directly in RTSPState when parsing the reply, instead of having to store large amounts of temporary data in RTSPMessageHeader. Originally committed as revision 26190 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rtsp.c12
-rw-r--r--libavformat/rtsp.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index a87190b23d..bc7e4e1b22 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -685,7 +685,7 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
}
void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
- HTTPAuthState *auth_state)
+ RTSPState *rt)
{
const char *p;
@@ -718,12 +718,12 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
} else if (av_stristart(p, "Location:", &p)) {
p += strspn(p, SPACE_CHARS);
av_strlcpy(reply->location, p , sizeof(reply->location));
- } else if (av_stristart(p, "WWW-Authenticate:", &p) && auth_state) {
+ } else if (av_stristart(p, "WWW-Authenticate:", &p) && rt) {
p += strspn(p, SPACE_CHARS);
- ff_http_auth_handle_header(auth_state, "WWW-Authenticate", p);
- } else if (av_stristart(p, "Authentication-Info:", &p) && auth_state) {
+ ff_http_auth_handle_header(&rt->auth_state, "WWW-Authenticate", p);
+ } else if (av_stristart(p, "Authentication-Info:", &p) && rt) {
p += strspn(p, SPACE_CHARS);
- ff_http_auth_handle_header(auth_state, "Authentication-Info", p);
+ ff_http_auth_handle_header(&rt->auth_state, "Authentication-Info", p);
} else if (av_stristart(p, "Content-Base:", &p)) {
p += strspn(p, SPACE_CHARS);
av_strlcpy(reply->content_base, p , sizeof(reply->content_base));
@@ -808,7 +808,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
reply->status_code = atoi(buf1);
av_strlcpy(reply->reason, p, sizeof(reply->reason));
} else {
- ff_rtsp_parse_line(reply, p, &rt->auth_state);
+ ff_rtsp_parse_line(reply, p, rt);
av_strlcat(rt->last_reply, p, sizeof(rt->last_reply));
av_strlcat(rt->last_reply, "\n", sizeof(rt->last_reply));
}
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index c0e025110d..fbe9e1a689 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -353,7 +353,7 @@ typedef struct RTSPStream {
} RTSPStream;
void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
- HTTPAuthState *auth_state);
+ RTSPState *rt);
extern int rtsp_rtp_port_min;
extern int rtsp_rtp_port_max;