aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-01-02 10:06:21 +0000
committerMartin Storsjö <martin@martin.st>2011-01-02 10:06:21 +0000
commit3df54c6bf2e5bc03b2dedcd60006d8f1df204ea3 (patch)
tree34b8c0bebf53cbe1e0c5797174081e0daecba9ef
parent7f8ffc4efddf796aa3aa8174fb008007cb8f8c1c (diff)
downloadffmpeg-3df54c6bf2e5bc03b2dedcd60006d8f1df204ea3.tar.gz
rtsp: Add a method parameter to ff_rtsp_read_reply
Originally committed as revision 26189 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rtsp.c6
-rw-r--r--libavformat/rtsp.h4
-rw-r--r--libavformat/rtspdec.c2
-rw-r--r--libavformat/rtspenc.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index ca84e5df2b..a87190b23d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -758,7 +758,7 @@ void ff_rtsp_skip_packet(AVFormatContext *s)
int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
unsigned char **content_ptr,
- int return_on_interleaved_data)
+ int return_on_interleaved_data, const char *method)
{
RTSPState *rt = s->priv_data;
char buf[4096], buf1[1024], *q;
@@ -936,7 +936,7 @@ retry:
send_content_length)))
return ret;
- if ((ret = ff_rtsp_read_reply(s, reply, content_ptr, 0) ) < 0)
+ if ((ret = ff_rtsp_read_reply(s, reply, content_ptr, 0, method) ) < 0)
return ret;
if (reply->status_code == 401 && cur_auth_type == HTTP_AUTH_NONE &&
@@ -1512,7 +1512,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
if (tcp_fd != -1 && FD_ISSET(tcp_fd, &rfds)) {
RTSPMessageHeader reply;
- ret = ff_rtsp_read_reply(s, &reply, NULL, 0);
+ ret = ff_rtsp_read_reply(s, &reply, NULL, 0, NULL);
if (ret < 0)
return ret;
/* XXX: parse message */
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index ba0526052b..c0e025110d 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -434,13 +434,15 @@ int ff_rtsp_send_cmd(AVFormatContext *s, const char *method,
* data packets (if they are encountered), until a reply
* has been fully parsed. If no more data is available
* without parsing a reply, it will return an error.
+ * @param method the RTSP method this is a reply to. This affects how
+ * some response headers are acted upon. May be NULL.
*
* @return 1 if a data packets is ready to be received, -1 on error,
* and 0 on success.
*/
int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
unsigned char **content_ptr,
- int return_on_interleaved_data);
+ int return_on_interleaved_data, const char *method);
/**
* Skip a RTP/TCP interleaved packet.
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index ad13b170aa..2ebc5156c7 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -170,7 +170,7 @@ redo:
for (;;) {
RTSPMessageHeader reply;
- ret = ff_rtsp_read_reply(s, &reply, NULL, 1);
+ ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL);
if (ret < 0)
return ret;
if (ret == 1) /* received '$' */
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index 007014ef1c..3a0b2c7e44 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -195,7 +195,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
* since it would block and wait for an RTSP reply on the socket
* (which may not be coming any time soon) if it handles
* interleaved packets internally. */
- ret = ff_rtsp_read_reply(s, &reply, NULL, 1);
+ ret = ff_rtsp_read_reply(s, &reply, NULL, 1, NULL);
if (ret < 0)
return AVERROR(EPIPE);
if (ret == 1)