summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-09 19:30:32 +0000
committerrtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-09 19:30:32 +0000
commit839c996198ef0571375a99d12352cab675725113 (patch)
tree6cd4bc85aca1346f1b2f828058fa2efd33420ffb /stream
parent1ff72c15b514022432f5324f42366eb498ff7576 (diff)
downloadmpv-839c996198ef0571375a99d12352cab675725113.tar.bz2
mpv-839c996198ef0571375a99d12352cab675725113.tar.xz
The size of xor_table is known and fixed, no need to calculate it
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22958 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/realrtsp/real.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index ad084b3e0c..7cbf8bf337 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -49,12 +49,14 @@
#define LOG
*/
-static const unsigned char xor_table[] = {
+#define XOR_TABLE_SIZE 45
+
+static const unsigned char xor_table[XOR_TABLE_SIZE] = {
0x05, 0x18, 0x74, 0xd0, 0x0d, 0x09, 0x02, 0x53,
0xc0, 0x01, 0x05, 0x05, 0x67, 0x03, 0x19, 0x70,
0x08, 0x27, 0x66, 0x10, 0x10, 0x72, 0x08, 0x09,
0x63, 0x11, 0x03, 0x71, 0x08, 0x08, 0x70, 0x02,
- 0x10, 0x57, 0x05, 0x18, 0x54, 0x00, 0x00, 0x00 };
+ 0x10, 0x57, 0x05, 0x18, 0x54 };
#define BUF_SIZE 4096
@@ -103,7 +105,7 @@ static void calc_response_string (char *result, char *challenge) {
static void real_calc_response_and_checksum (char *response, char *chksum, char *challenge) {
- int ch_len, table_len, resp_len;
+ int ch_len, resp_len;
int i;
char *ptr;
char buf[128];
@@ -136,12 +138,8 @@ static void real_calc_response_and_checksum (char *response, char *chksum, char
memcpy(ptr, challenge, ch_len);
}
- table_len = strlen(xor_table);
-
- if (table_len > 56) table_len=56;
-
/* xor challenge bytewise with xor_table */
- for (i=0; i<table_len; i++)
+ for (i=0; i<XOR_TABLE_SIZE; i++)
ptr[i] = ptr[i] ^ xor_table[i];
calc_response_string (response, buf);