Allow $ as character anywhere within normal RTSP replies - both
within the lines, and as the first character of RTSP header lines.
(The existing old comment indicated that an inline packet could
start at any line within a RTSP reply header, but that doesn't
sound valid to me, and I'm not sure if the existing code
handled that correctly either.)
---
libavformat/rtsp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2200f6e..947e88f 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1081,6 +1081,7 @@ int ff_rtsp_read_reply(AVFormatContext *s,
RTSPMessageHeader *reply,
unsigned char ch;
const char *p;
int ret, content_length, line_count = 0, request = 0;
+ int first_line = 1;
unsigned char *content = NULL;
start:
@@ -1100,8 +1101,7 @@ start:
return AVERROR_EOF;
if (ch == '\n')
break;
- if (ch == '$') {
- /* XXX: only parse it if first char on line ? */
+ if (ch == '$' && first_line && q == buf) {
if (return_on_interleaved_data) {
return 1;
} else
@@ -1112,6 +1112,7 @@ start:
}
}
*q = '\0';
+ first_line = 0;
av_dlog(s, "line='%s'\n", buf);
--
1.9.3 (Apple Git-50)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel