From b24e6c2e94115f7bf731bc2e8f967cefd86bf873 Mon Sep 17 00:00:00 2001 From: hyc Date: Sun, 28 Mar 2010 20:14:52 +0000 Subject: [PATCH] Revert prev commit, use \xx for escaping spaces git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@410 400ebc74-4327-4243-bc38-086b20814532 --- librtmp/rtmp.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index ffe32e8..e0f0c0a 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -645,25 +645,15 @@ bool RTMP_SetupURL(RTMP *r, char *url) arg.av_len = strlen(p2); } - /* Decode embedded spaces. Spaces are encoded as TAB+Ctrl-A. - * TABs are encoded as TAB+Ctrl-B. For TAB+anything else the - * TAB is dropped. - */ + /* unescape */ port = arg.av_len; for (p1=p2; port >0;) { - if (*p1 == 0x08) { - if (p1[1] == 0x01) { - *p2++ = ' '; - port -= 2; - p1 += 2; - } else if (p1[1] == 0x02) { - *p2++ = 0x08; - port -= 2; - p1 += 2; - } else { - p1++; - port--; - } + if (*p1 == '\\') { + int c; + sscanf(p1+1, "%02x", &c); + *p2++ = c; + port -= 3; + p1 += 3; } else { *p2++ = *p1++; port--; -- 2.50.1