29 #include <sys/types.h> 59 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 60 "abcdefghijklmnopqrstuvwxyz" 62 char *p = (
char *)(*data);
63 int symbols, bytes, i, j;
69 symbols = strspn(p, base64);
70 if (symbols > 0 && symbols % 4 == 0)
72 bytes = symbols * 3 / 4;
73 if (p[symbols - 1] ==
'=')
77 if (p[symbols - 2] ==
'=')
83 for (i = 0, j = 0; i < symbols; i += 4)
85 b0 = strchr(base64, *p++) - base64;
86 b1 = strchr(base64, *p++) - base64;
87 b2 = strchr(base64, *p++) - base64;
88 b3 = strchr(base64, *p++) - base64;
90 key[j++] = b0 << 2 | b1 >> 4;
93 key[j++] = b1 << 4 | b2 >> 2;
96 key[j++] = b2 << 6 | b3;
146 p = (
U8BIT *)strchr((
char *)p + 1,
':');
151 num_pids = (colons + 1) / 4;
157 for (i = 0; i < num_pids; ++i)
165 while (*data >=
'0' && *data <=
'9')
168 pid_info->
PID += *data -
'0';
180 success = DecodeKey(&data, pid_info->
iv, 16);
181 if (!success || *data !=
':')
188 success = DecodeKey(&data, pid_info->
odd_key, 16);
189 if (!success || *data !=
':')
196 success = DecodeKey(&data, pid_info->
even_key, 16);
251 static const char *lws =
"\r\n \t";
254 keyLocation->
len = strcspn((
char *)data, lws);
258 if (keyLocation->
data != NULL)
260 memcpy(keyLocation->
data, data, keyLocation->
len);
261 keyLocation->
data[keyLocation->
len] =
'\0';
265 keyLocation->
len = 0;
281 *knownBitrate =
FALSE;
283 if (*data >=
'1' && *data <=
'9')
285 *bytesPerSecond = *data -
'0';
288 while (*data >=
'0' && *data <=
'9')
290 *bytesPerSecond *= 10;
291 *bytesPerSecond += *data -
'0';
295 if (*data ==
'\r' || *data ==
'\n')
297 *knownBitrate =
TRUE;
Common header internal to IC streamer.
unsigned char * STR_DataAlloc(unsigned int size)
string parsing utility functions for MHEG5