rtsp: Only interpret $ as interleaved packet indicator at the start of replies
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.) CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
6877537ff3
commit
764ec70149
1 changed files with 3 additions and 2 deletions
|
@ -1128,6 +1128,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
|
||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
const char *p;
|
const char *p;
|
||||||
int ret, content_length, line_count = 0, request = 0;
|
int ret, content_length, line_count = 0, request = 0;
|
||||||
|
int first_line = 1;
|
||||||
unsigned char *content = NULL;
|
unsigned char *content = NULL;
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
@ -1147,8 +1148,7 @@ start:
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
break;
|
break;
|
||||||
if (ch == '$') {
|
if (ch == '$' && first_line && q == buf) {
|
||||||
/* XXX: only parse it if first char on line ? */
|
|
||||||
if (return_on_interleaved_data) {
|
if (return_on_interleaved_data) {
|
||||||
return 1;
|
return 1;
|
||||||
} else
|
} else
|
||||||
|
@ -1159,6 +1159,7 @@ start:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*q = '\0';
|
*q = '\0';
|
||||||
|
first_line = 0;
|
||||||
|
|
||||||
av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);
|
av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue