[MPlayer-cvslog] r18856 - trunk/libmpdemux/librtsp/rtsp.c
ben
subversion at mplayerhq.hu
Thu Jun 29 23:46:52 CEST 2006
Author: ben
Date: Thu Jun 29 23:46:51 2006
New Revision: 18856
Modified:
trunk/libmpdemux/librtsp/rtsp.c
Log:
be more tolerant on server responses parameters case (fix 1.17 from xine, see http://xine.cvs.sourceforge.net/xine/xine-lib/src/input/librtsp/rtsp.c?r1=1.16&r2=1.17)
Modified: trunk/libmpdemux/librtsp/rtsp.c
==============================================================================
--- trunk/libmpdemux/librtsp/rtsp.c (original)
+++ trunk/libmpdemux/librtsp/rtsp.c Thu Jun 29 23:46:51 2006
@@ -332,8 +332,8 @@
if (!answer)
return 0;
- if (!strncmp(answer,"CSeq:",5)) {
- sscanf(answer,"CSeq: %u",&answer_seq);
+ if (!strncasecmp(answer,"CSeq:",5)) {
+ sscanf(answer,"%*s %u",&answer_seq);
if (s->cseq != answer_seq) {
#ifdef LOG
mp_msg(MSGT_OPEN, MSGL_WARN, "librtsp: warning: CSeq mismatch. got %u, assumed %u", answer_seq, s->cseq);
@@ -341,16 +341,16 @@
s->cseq=answer_seq;
}
}
- if (!strncmp(answer,"Server:",7)) {
+ if (!strncasecmp(answer,"Server:",7)) {
char *buf = malloc(strlen(answer));
- sscanf(answer,"Server: %s",buf);
+ sscanf(answer,"%*s %s",buf);
if (s->server) free(s->server);
s->server=strdup(buf);
free(buf);
}
- if (!strncmp(answer,"Session:",8)) {
+ if (!strncasecmp(answer,"Session:",8)) {
char *buf = calloc(1, strlen(answer));
- sscanf(answer,"Session: %s",buf);
+ sscanf(answer,"%*s %s",buf);
if (s->session) {
if (strcmp(buf, s->session)) {
mp_msg(MSGT_OPEN, MSGL_WARN, "rtsp: warning: setting NEW session: %s\n", buf);
@@ -536,8 +536,8 @@
rest=rtsp_get(s);
if (!rest)
return -1;
- if (!strncmp(rest,"CSeq:",5))
- sscanf(rest,"CSeq: %u",&seq);
+ if (!strncasecmp(rest,"CSeq:",5))
+ sscanf(rest,"%*s %u",&seq);
} while (strlen(rest)!=0);
free(rest);
if (seq<0) {
More information about the MPlayer-cvslog
mailing list