summaryrefslogtreecommitdiff
path: root/src/input/libreal
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/libreal')
-rw-r--r--src/input/libreal/asmrp.c38
-rw-r--r--src/input/libreal/real.c106
-rw-r--r--src/input/libreal/real.h2
-rw-r--r--src/input/libreal/rmff.c64
-rw-r--r--src/input/libreal/rmff.h10
-rw-r--r--src/input/libreal/sdpplin.c32
-rw-r--r--src/input/libreal/sdpplin.h4
7 files changed, 128 insertions, 128 deletions
diff --git a/src/input/libreal/asmrp.c b/src/input/libreal/asmrp.c
index 902c59d42..2c02c2f13 100644
--- a/src/input/libreal/asmrp.c
+++ b/src/input/libreal/asmrp.c
@@ -2,7 +2,7 @@
* Copyright (C) 2002-2004 the xine project
*
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -85,7 +85,7 @@ typedef struct {
int sym;
int num;
-
+
char str[ASMRP_MAX_ID];
/* private part */
@@ -115,7 +115,7 @@ static void asmrp_dispose (asmrp_t *p) {
int i;
- for (i=0; i<p->sym_tab_num; i++)
+ for (i=0; i<p->sym_tab_num; i++)
free (p->sym_tab[i].id);
free (p);
@@ -133,7 +133,7 @@ static void asmrp_init (asmrp_t *p, const char *str) {
p->buf = strdup (str);
p->pos = 0;
-
+
asmrp_getch (p);
}
@@ -167,10 +167,10 @@ static void asmrp_string (asmrp_t *p) {
asmrp_getch (p);
}
p->str[l]=0;
-
+
if (p->ch=='"')
asmrp_getch (p);
-
+
p->sym = ASMRP_SYM_STRING;
}
@@ -189,7 +189,7 @@ static void asmrp_identifier (asmrp_t *p) {
asmrp_getch (p);
}
p->str[l]=0;
-
+
p->sym = ASMRP_SYM_ID;
}
@@ -387,10 +387,10 @@ static int asmrp_set_id (asmrp_t *p, char *s, int v) {
lprintf ("new symbol '%s'\n", s);
- }
+ }
p->sym_tab[i].v = v;
-
+
lprintf ("symbol '%s' assigned %d\n", s, v);
return i;
@@ -401,7 +401,7 @@ static int asmrp_condition (asmrp_t *p) ;
static int asmrp_operand (asmrp_t *p) {
int i, ret;
-
+
lprintf ("operand\n");
ret = 0;
@@ -411,7 +411,7 @@ static int asmrp_operand (asmrp_t *p) {
case ASMRP_SYM_DOLLAR:
asmrp_get_sym (p);
-
+
if (p->sym != ASMRP_SYM_ID) {
printf ("error: identifier expected.\n");
_x_abort();
@@ -453,7 +453,7 @@ static int asmrp_operand (asmrp_t *p) {
}
lprintf ("operand done, =%d\n", ret);
-
+
return ret;
}
@@ -503,7 +503,7 @@ static int asmrp_comp_expression (asmrp_t *p) {
}
static int asmrp_condition (asmrp_t *p) {
-
+
int a;
lprintf ("condition\n");
@@ -542,7 +542,7 @@ static void asmrp_assignment (asmrp_t *p) {
lprintf ("empty assignment\n");
return;
}
-
+
if (p->sym != ASMRP_SYM_ID) {
printf ("error: identifier expected\n");
_x_abort ();
@@ -555,7 +555,7 @@ static void asmrp_assignment (asmrp_t *p) {
}
asmrp_get_sym (p);
- if ( (p->sym != ASMRP_SYM_NUM) && (p->sym != ASMRP_SYM_STRING)
+ if ( (p->sym != ASMRP_SYM_NUM) && (p->sym != ASMRP_SYM_STRING)
&& (p->sym != ASMRP_SYM_ID)) {
printf ("error: number or string expected\n");
_x_abort ();
@@ -566,22 +566,22 @@ static void asmrp_assignment (asmrp_t *p) {
}
static int asmrp_rule (asmrp_t *p) {
-
+
int ret;
lprintf ("rule\n");
ret = 1;
-
+
if (p->sym == ASMRP_SYM_HASH) {
asmrp_get_sym (p);
ret = asmrp_condition (p);
while (p->sym == ASMRP_SYM_COMMA) {
-
+
asmrp_get_sym (p);
-
+
asmrp_assignment (p);
}
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index dcb90bcd0..9b72c7e57 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -55,20 +55,20 @@ static const unsigned char xor_table[] = {
static void hash(char *field, char *param) {
uint32_t a, b, c, d;
-
+
/* fill variables */
a = _X_LE_32(field);
b = _X_LE_32(field+4);
c = _X_LE_32(field+8);
d = _X_LE_32(field+12);
-
+
lprintf("hash input: %x %x %x %x\n", a, b, c, d);
lprintf("hash parameter:\n");
#ifdef LOG
xine_hexdump(param, 64);
#endif
-
+
a = ((b & c) | (~b & d)) + _X_LE_32((param+0x00)) + a - 0x28955B88;
a = ((a << 0x07) | (a >> 0x19)) + b;
d = ((a & b) | (~a & c)) + _X_LE_32((param+0x04)) + d - 0x173848AA;
@@ -101,7 +101,7 @@ static void hash(char *field, char *param) {
c = ((c << 0x11) | (c >> 0x0f)) + d;
b = ((c & d) | (~c & a)) + _X_LE_32((param+0x3c)) + b + 0x49B40821;
b = ((b << 0x16) | (b >> 0x0a)) + c;
-
+
a = ((b & d) | (~d & c)) + _X_LE_32((param+0x04)) + a - 0x09E1DA9E;
a = ((a << 0x05) | (a >> 0x1b)) + b;
d = ((a & c) | (~c & b)) + _X_LE_32((param+0x18)) + d - 0x3FBF4CC0;
@@ -134,7 +134,7 @@ static void hash(char *field, char *param) {
c = ((c << 0x0e) | (c >> 0x12)) + d;
b = ((c & a) | (~a & d)) + _X_LE_32((param+0x30)) + b - 0x72D5B376;
b = ((b << 0x14) | (b >> 0x0c)) + c;
-
+
a = (b ^ c ^ d) + _X_LE_32((param+0x14)) + a - 0x0005C6BE;
a = ((a << 0x04) | (a >> 0x1c)) + b;
d = (a ^ b ^ c) + _X_LE_32((param+0x20)) + d - 0x788E097F;
@@ -167,42 +167,42 @@ static void hash(char *field, char *param) {
c = ((c << 0x10) | (c >> 0x10)) + d;
b = (c ^ d ^ a) + _X_LE_32((param+0x08)) + b - 0x3B53A99B;
b = ((b << 0x17) | (b >> 0x09)) + c;
-
+
a = ((~d | b) ^ c) + _X_LE_32((param+0x00)) + a - 0x0BD6DDBC;
- a = ((a << 0x06) | (a >> 0x1a)) + b;
+ a = ((a << 0x06) | (a >> 0x1a)) + b;
d = ((~c | a) ^ b) + _X_LE_32((param+0x1c)) + d + 0x432AFF97;
- d = ((d << 0x0a) | (d >> 0x16)) + a;
+ d = ((d << 0x0a) | (d >> 0x16)) + a;
c = ((~b | d) ^ a) + _X_LE_32((param+0x38)) + c - 0x546BDC59;
- c = ((c << 0x0f) | (c >> 0x11)) + d;
+ c = ((c << 0x0f) | (c >> 0x11)) + d;
b = ((~a | c) ^ d) + _X_LE_32((param+0x14)) + b - 0x036C5FC7;
- b = ((b << 0x15) | (b >> 0x0b)) + c;
+ b = ((b << 0x15) | (b >> 0x0b)) + c;
a = ((~d | b) ^ c) + _X_LE_32((param+0x30)) + a + 0x655B59C3;
- a = ((a << 0x06) | (a >> 0x1a)) + b;
+ a = ((a << 0x06) | (a >> 0x1a)) + b;
d = ((~c | a) ^ b) + _X_LE_32((param+0x0C)) + d - 0x70F3336E;
- d = ((d << 0x0a) | (d >> 0x16)) + a;
+ d = ((d << 0x0a) | (d >> 0x16)) + a;
c = ((~b | d) ^ a) + _X_LE_32((param+0x28)) + c - 0x00100B83;
- c = ((c << 0x0f) | (c >> 0x11)) + d;
+ c = ((c << 0x0f) | (c >> 0x11)) + d;
b = ((~a | c) ^ d) + _X_LE_32((param+0x04)) + b - 0x7A7BA22F;
- b = ((b << 0x15) | (b >> 0x0b)) + c;
+ b = ((b << 0x15) | (b >> 0x0b)) + c;
a = ((~d | b) ^ c) + _X_LE_32((param+0x20)) + a + 0x6FA87E4F;
- a = ((a << 0x06) | (a >> 0x1a)) + b;
+ a = ((a << 0x06) | (a >> 0x1a)) + b;
d = ((~c | a) ^ b) + _X_LE_32((param+0x3c)) + d - 0x01D31920;
- d = ((d << 0x0a) | (d >> 0x16)) + a;
+ d = ((d << 0x0a) | (d >> 0x16)) + a;
c = ((~b | d) ^ a) + _X_LE_32((param+0x18)) + c - 0x5CFEBCEC;
- c = ((c << 0x0f) | (c >> 0x11)) + d;
+ c = ((c << 0x0f) | (c >> 0x11)) + d;
b = ((~a | c) ^ d) + _X_LE_32((param+0x34)) + b + 0x4E0811A1;
- b = ((b << 0x15) | (b >> 0x0b)) + c;
+ b = ((b << 0x15) | (b >> 0x0b)) + c;
a = ((~d | b) ^ c) + _X_LE_32((param+0x10)) + a - 0x08AC817E;
- a = ((a << 0x06) | (a >> 0x1a)) + b;
+ a = ((a << 0x06) | (a >> 0x1a)) + b;
d = ((~c | a) ^ b) + _X_LE_32((param+0x2c)) + d - 0x42C50DCB;
- d = ((d << 0x0a) | (d >> 0x16)) + a;
+ d = ((d << 0x0a) | (d >> 0x16)) + a;
c = ((~b | d) ^ a) + _X_LE_32((param+0x08)) + c + 0x2AD7D2BB;
- c = ((c << 0x0f) | (c >> 0x11)) + d;
+ c = ((c << 0x0f) | (c >> 0x11)) + d;
b = ((~a | c) ^ d) + _X_LE_32((param+0x24)) + b - 0x14792C6F;
- b = ((b << 0x15) | (b >> 0x0b)) + c;
+ b = ((b << 0x15) | (b >> 0x0b)) + c;
lprintf("hash output: %x %x %x %x\n", a, b, c, d);
-
+
a += _X_LE_32(field);
b += _X_LE_32(field+4);
c += _X_LE_32(field+8);
@@ -218,15 +218,15 @@ static void call_hash (char *key, char *challenge, unsigned int len) {
char *ptr1, *ptr2;
uint32_t a, b, c, d, tmp;
-
+
ptr1=(key+16);
ptr2=(key+20);
-
+
a = _X_LE_32(ptr1);
b = (a >> 3) & 0x3f;
a += len * 8;
_X_LE_32C(ptr1, a);
-
+
if (a < (len << 3))
{
lprintf("not verified: (len << 3) > a true\n");
@@ -236,7 +236,7 @@ static void call_hash (char *key, char *challenge, unsigned int len) {
tmp = _X_LE_32(ptr2) + (len >> 0x1d);
_X_LE_32C(ptr2, tmp);
a = 64 - b;
- c = 0;
+ c = 0;
if (a <= len)
{
@@ -244,7 +244,7 @@ static void call_hash (char *key, char *challenge, unsigned int len) {
hash(key, key+24);
c = a;
d = c + 0x3f;
-
+
while ( d < len ) {
lprintf("not verified: while ( d < len )\n");
hash(key, challenge+d-0x3f);
@@ -253,7 +253,7 @@ static void call_hash (char *key, char *challenge, unsigned int len) {
}
b = 0;
}
-
+
memcpy(key+b+24, challenge+c, len-c);
}
@@ -265,11 +265,11 @@ static void calc_response (char *result, char *field) {
memset (buf1, 0, 64);
*buf1 = 128;
-
+
memcpy (buf2, field+16, 8);
-
+
i = ( _X_LE_32((buf2)) >> 3 ) & 0x3f;
-
+
if (i < 56) {
i = 56 - i;
} else {
@@ -286,7 +286,7 @@ static void calc_response (char *result, char *field) {
static void calc_response_string (char *result, char *challenge) {
-
+
char field[128] = {
0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
@@ -295,15 +295,15 @@ static void calc_response_string (char *result, char *challenge) {
};
char zres[20];
int i;
-
+
/* calculate response */
call_hash(field, challenge, 64);
calc_response(zres,field);
-
+
/* convert zres to ascii string */
for (i=0; i<16; i++ ) {
char a, b;
-
+
a = (zres[i] >> 4) & 15;
b = zres[i] & 15;
@@ -342,11 +342,11 @@ void real_calc_response_and_checksum (char *response, char *chksum, char *challe
ch_len=32;
}
if ( ch_len > 56 ) ch_len=56;
-
+
/* copy challenge to buf */
memcpy(ptr, challenge, ch_len);
}
-
+
/* xor challenge bytewise with xor_table */
for (i=0; i<XOR_TABLE_LEN; i++)
ptr[i] = ptr[i] ^ xor_table[i];
@@ -372,7 +372,7 @@ static int select_mlti_data(const char *mlti_chunk, int mlti_size, int selection
int numrules, codec, size;
int i;
-
+
/* MLTI chunk should begin with MLTI */
if ((mlti_chunk[0] != 'M')
@@ -410,13 +410,13 @@ static int select_mlti_data(const char *mlti_chunk, int mlti_size, int selection
}
mlti_chunk+=2;
-
+
/* now seek to selected codec */
for (i=0; i<codec; i++) {
size=_X_BE_32(mlti_chunk);
mlti_chunk+=size+4;
}
-
+
size=_X_BE_32(mlti_chunk);
#ifdef LOG
@@ -441,14 +441,14 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
int max_packet_size=0;
int avg_packet_size=0;
int duration=0;
-
+
if (!data) return NULL;
desc=sdpplin_parse(data);
if (!desc) return NULL;
-
+
buf=xine_buffer_init(2048);
header = calloc(1, sizeof(rmff_header_t));
@@ -484,7 +484,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
}
else
len=select_mlti_data(desc->stream[i]->mlti_data, desc->stream[i]->mlti_data_size, rulematches[0], &buf);
-
+
header->streams[i]=rmff_new_mdpr(
desc->stream[i]->stream_id,
desc->stream[i]->max_bit_rate,
@@ -508,7 +508,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
else
avg_packet_size=desc->stream[i]->avg_packet_size;
}
-
+
if (*stream_rules && strlen(*stream_rules) && (*stream_rules)[strlen(*stream_rules)-1] == ',')
(*stream_rules)[strlen(*stream_rules)-1]=0; /* delete last ',' in stream_rules */
@@ -577,12 +577,12 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, unsigned char **buffer) {
n=rtsp_read_data(rtsp_session, header, 6);
if (n<6) return 0;
ts=_X_BE_32(header);
-
- lprintf("ts: %u size: %u, flags: 0x%02x, unknown values: %u 0x%02x 0x%02x\n",
+
+ lprintf("ts: %u size: %u, flags: 0x%02x, unknown values: %u 0x%02x 0x%02x\n",
ts, size, flags1, unknown1, header[4], header[5]);
size+=2;
-
+
ph.object_version=0;
ph.length=size;
ph.stream_number=(flags1>>1)&1;
@@ -593,7 +593,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, unsigned char **buffer) {
rmff_dump_pheader(&ph, *buffer);
size-=12;
n=rtsp_read_data(rtsp_session, (*buffer)+12, size);
-
+
return (n <= 0) ? 0 : n+12;
}
@@ -612,11 +612,11 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwid
char *mrl=rtsp_get_mrl(rtsp_session);
unsigned int size;
int status;
-
+
/* get challenge */
challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
lprintf("Challenge1: %s\n", challenge1);
-
+
/* request stream description */
rtsp_schedule_field(rtsp_session, "Accept: application/sdp");
sprintf(buf, "Bandwidth: %u", bandwidth);
@@ -658,7 +658,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwid
lprintf("real: got no ETag!\n");
else
session_id=strdup(rtsp_search_answers(rtsp_session,"ETag"));
-
+
lprintf("Stream description size: %i\n", size);
description = malloc(size+1);
@@ -682,7 +682,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwid
lprintf("Title: %s\nCopyright: %s\nAuthor: %s\nStreams: %i\n",
h->cont->title, h->cont->copyright, h->cont->author, h->prop->num_streams);
-
+
/* setup our streams */
real_calc_response_and_checksum (challenge2, checksum, challenge1);
xine_buffer_ensure_size(buf, strlen(challenge2) + strlen(checksum) + 32);
diff --git a/src/input/libreal/real.h b/src/input/libreal/real.h
index edcd170f8..f299b909b 100644
--- a/src/input/libreal/real.h
+++ b/src/input/libreal/real.h
@@ -20,7 +20,7 @@
* special functions for real streams.
* adopted from joschkas real tools.
*/
-
+
#ifndef HAVE_REAL_H
#define HAVE_REAL_H
diff --git a/src/input/libreal/rmff.c b/src/input/libreal/rmff.c
index 2d3fcc613..6a2b761e1 100644
--- a/src/input/libreal/rmff.c
+++ b/src/input/libreal/rmff.c
@@ -51,7 +51,7 @@ static int rmff_dump_fileheader(rmff_fileheader_t *fileheader, uint8_t *buffer,
fileheader->object_version=_X_BE_16(&fileheader->object_version);
fileheader->file_version=_X_BE_32(&fileheader->file_version);
fileheader->num_headers=_X_BE_32(&fileheader->num_headers);
-
+
memcpy(buffer, fileheader, 8);
memcpy(&buffer[8], &fileheader->object_version, 2);
memcpy(&buffer[10], &fileheader->file_version, 8);
@@ -92,7 +92,7 @@ static int rmff_dump_prop(rmff_prop_t *prop, uint8_t *buffer, int bufsize) {
memcpy(&buffer[10], &prop->max_bit_rate, 36);
memcpy(&buffer[46], &prop->num_streams, 2);
memcpy(&buffer[48], &prop->flags, 2);
-
+
prop->size=_X_BE_32(&prop->size);
prop->object_version=_X_BE_16(&prop->object_version);
prop->max_bit_rate=_X_BE_32(&prop->max_bit_rate);
@@ -143,7 +143,7 @@ static int rmff_dump_mdpr(rmff_mdpr_t *mdpr, uint8_t *buffer, int bufsize) {
memcpy(&buffer[41+s1], &mdpr->mime_type_size, 1);
s2=mdpr->mime_type_size;
memcpy(&buffer[42+s1], mdpr->mime_type, s2);
-
+
mdpr->type_specific_len=_X_BE_32(&mdpr->type_specific_len);
memcpy(&buffer[42+s1+s2], &mdpr->type_specific_len, 4);
mdpr->type_specific_len=_X_BE_32(&mdpr->type_specific_len);
@@ -180,7 +180,7 @@ static int rmff_dump_cont(rmff_cont_t *cont, uint8_t *buffer, int bufsize) {
memcpy(buffer, cont, 8);
memcpy(&buffer[8], &cont->object_version, 2);
-
+
cont->title_len=_X_BE_16(&cont->title_len);
memcpy(&buffer[10], &cont->title_len, 2);
cont->title_len=_X_BE_16(&cont->title_len);
@@ -228,7 +228,7 @@ static int rmff_dump_dataheader(rmff_data_t *data, uint8_t *buffer, int bufsize)
memcpy(buffer, data, 8);
memcpy(&buffer[8], &data->object_version, 2);
memcpy(&buffer[10], &data->num_packets, 8);
-
+
data->num_packets=_X_BE_32(&data->num_packets);
data->next_data_header=_X_BE_32(&data->next_data_header);
data->size=_X_BE_32(&data->size);
@@ -267,7 +267,7 @@ int rmff_dump_header(rmff_header_t *h, void *buf_gen, int max) {
stream++;
}
}
-
+
if ((size=rmff_dump_dataheader(h->data, &buffer[written], max)) < 0)
return -1;
written+=size;
@@ -355,7 +355,7 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data)
mdpr->start_time=_X_BE_32(&data[28]);
mdpr->preroll=_X_BE_32(&data[32]);
mdpr->duration=_X_BE_32(&data[36]);
-
+
mdpr->stream_name_size=data[40];
if (mdpr->size < 46 + mdpr->stream_name_size)
goto fail;
@@ -364,7 +364,7 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data)
goto fail;
memcpy(mdpr->stream_name, &data[41], mdpr->stream_name_size);
mdpr->stream_name[mdpr->stream_name_size]=0;
-
+
mdpr->mime_type_size=data[41+mdpr->stream_name_size];
if (mdpr->size < 46 + mdpr->stream_name_size + mdpr->mime_type_size)
goto fail;
@@ -373,16 +373,16 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data)
goto fail;
memcpy(mdpr->mime_type, &data[42+mdpr->stream_name_size], mdpr->mime_type_size);
mdpr->mime_type[mdpr->mime_type_size]=0;
-
+
mdpr->type_specific_len=_X_BE_32(&data[42+mdpr->stream_name_size+mdpr->mime_type_size]);
if (mdpr->size < 46 + mdpr->stream_name_size + mdpr->mime_type_size + mdpr->type_specific_data)
goto fail;
mdpr->type_specific_data = malloc(mdpr->type_specific_len);
if (!mdpr->type_specific_data)
goto fail;
- memcpy(mdpr->type_specific_data,
+ memcpy(mdpr->type_specific_data,
&data[46+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
-
+
return mdpr;
fail:
@@ -444,7 +444,7 @@ static rmff_data_t *rmff_scan_dataheader(const char *data) {
return dh;
}
-
+
rmff_header_t *rmff_scan_header(const char *data) {
rmff_header_t *header = malloc(sizeof(rmff_header_t));
@@ -468,18 +468,18 @@ rmff_header_t *rmff_scan_header(const char *data) {
}
header->fileheader=rmff_scan_fileheader(ptr);
ptr += header->fileheader->size;
-
+
header->streams = calloc(header->fileheader->num_headers, sizeof(rmff_mdpr_t*));
-
+
for (i=1; i<header->fileheader->num_headers; i++) {
chunk_type = _X_BE_32(ptr);
-
+
if (ptr[0] == 0)
{
lprintf("rmff: warning: only %d of %d header found.\n", i, header->fileheader->num_headers);
break;
}
-
+
chunk_size=1;
switch (chunk_type) {
case PROP_TAG:
@@ -610,7 +610,7 @@ rmff_prop_t *rmff_new_prop (
prop->data_offset=data_offset;
prop->num_streams=num_streams;
prop->flags=flags;
-
+
return prop;
}
@@ -629,7 +629,7 @@ rmff_mdpr_t *rmff_new_mdpr(
const char *type_specific_data ) {
rmff_mdpr_t *mdpr = malloc(sizeof(rmff_mdpr_t));
-
+
mdpr->object_id=MDPR_TAG;
mdpr->object_version=0;
@@ -655,7 +655,7 @@ rmff_mdpr_t *rmff_new_mdpr(
mdpr->type_specific_data = malloc(type_specific_len);
memcpy(mdpr->type_specific_data,type_specific_data,type_specific_len);
mdpr->mlti_data=NULL;
-
+
mdpr->size=mdpr->stream_name_size+mdpr->mime_type_size+mdpr->type_specific_len+46;
return mdpr;
@@ -672,7 +672,7 @@ rmff_cont_t *rmff_new_cont(const char *title, const char *author, const char *co
cont->author=NULL;
cont->copyright=NULL;
cont->comment=NULL;
-
+
cont->title_len=0;
cont->author_len=0;
cont->copyright_len=0;
@@ -711,11 +711,11 @@ rmff_data_t *rmff_new_dataheader(uint32_t num_packets, uint32_t next_data_header
return data;
}
-
+
void rmff_print_header(rmff_header_t *h) {
rmff_mdpr_t **stream;
-
+
if(!h) {
printf("rmff_print_header: NULL given\n");
return;
@@ -776,7 +776,7 @@ void rmff_print_header(rmff_header_t *h) {
printf("size : %i\n", h->data->size);
printf("packets : %i\n", h->data->num_packets);
printf("next DATA : 0x%08x\n", h->data->next_data_header);
- }
+ }
}
void rmff_fix_header(rmff_header_t *h) {
@@ -804,7 +804,7 @@ void rmff_fix_header(rmff_header_t *h) {
streams++;
}
}
-
+
if (h->prop) {
if (h->prop->size != 50)
{
@@ -841,7 +841,7 @@ void rmff_fix_header(rmff_header_t *h) {
}
num_headers++;
-
+
if (!h->fileheader) {
lprintf("rmff_fix_header: no fileheader, creating one");
@@ -856,31 +856,31 @@ void rmff_fix_header(rmff_header_t *h) {
num_headers++;
if(h->fileheader->num_headers != num_headers) {
- lprintf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers);
+ lprintf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers);
h->fileheader->num_headers=num_headers;
}
if(h->prop) {
if (h->prop->data_offset != header_size) {
- lprintf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size);
+ lprintf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size);
h->prop->data_offset=header_size;
}
if (h->prop->num_packets == 0) {
int p=(int)(h->prop->avg_bit_rate/8.0*(h->prop->duration/1000.0)/h->prop->avg_packet_size);
- lprintf("rmff_fix_header: assuming prop.num_packets=%i\n", p);
+ lprintf("rmff_fix_header: assuming prop.num_packets=%i\n", p);
h->prop->num_packets=p;
}
if (h->data->num_packets == 0) {
- lprintf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets);
+ lprintf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets);
h->data->num_packets=h->prop->num_packets;
}
-
- lprintf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size);
+
+ lprintf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size);
h->data->size=h->prop->num_packets*h->prop->avg_packet_size;
}
@@ -892,7 +892,7 @@ int rmff_get_header_size(rmff_header_t *h) {
if (!h->prop) return -1;
return h->prop->data_offset+18;
-
+
}
void rmff_free_header(rmff_header_t *h) {
diff --git a/src/input/libreal/rmff.h b/src/input/libreal/rmff.h
index 50656349d..20b8b8960 100644
--- a/src/input/libreal/rmff.h
+++ b/src/input/libreal/rmff.h
@@ -98,7 +98,7 @@ typedef struct {
uint32_t data_offset;
uint16_t num_streams;
uint16_t flags;
-
+
} rmff_prop_t;
typedef struct {
@@ -141,11 +141,11 @@ typedef struct {
char *copyright;
uint16_t comment_len;
char *comment;
-
+
} rmff_cont_t;
typedef struct {
-
+
uint32_t object_id;
uint32_t size;
uint16_t object_version;
@@ -178,7 +178,7 @@ typedef struct {
/*
* constructors for header structs
*/
-
+
rmff_fileheader_t *rmff_new_fileheader(uint32_t num_headers);
rmff_prop_t *rmff_new_prop (
@@ -247,7 +247,7 @@ void rmff_fix_header(rmff_header_t *h);
* returns the size of the header (incl. first data-header)
*/
int rmff_get_header_size(rmff_header_t *h);
-
+
/*
* dumps the header <h> to <buffer>. <max> is the size of <buffer>
*/
diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c
index a07cb3360..b7e5218cb 100644
--- a/src/input/libreal/sdpplin.c
+++ b/src/input/libreal/sdpplin.c
@@ -23,7 +23,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-
+
#define LOG_MODULE "sdpplin"
#define LOG_VERBOSE
/*
@@ -62,7 +62,7 @@ static char *b64_decode(const char *in, char *out, int *size)
dtable['='] = 0;
k=0;
-
+
/*CONSTANTCONDITION*/
const size_t in_len = strlen(in);
for (j=0; j<in_len; j+=4)
@@ -106,10 +106,10 @@ static int filter(const char *in, const char *filter, char **out) {
size_t flen=strlen(filter);
size_t len;
-
+
if (!in)
return 0;
-
+
len = (strchr(in,'\n')) ? (size_t)(strchr(in,'\n')-in) : strlen(in);
if (!strncmp(in,filter,flen))
@@ -122,7 +122,7 @@ static int filter(const char *in, const char *filter, char **out) {
return len-flen;
}
-
+
return 0;
}
static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
@@ -131,7 +131,7 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
char *buf=xine_buffer_init(32);
char *decoded=xine_buffer_init(32);
int handled;
-
+
if (filter(*data, "m=", &buf)) {
desc->id = strdup(buf);
} else
@@ -146,7 +146,7 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
while (*data && **data && *data[0]!='m') {
handled=0;
-
+
if(filter(*data,"a=control:streamid=",&buf)) {
/* This way negative values are mapped to unfeasibly high
* values, and will be discarded afterward
@@ -175,7 +175,7 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
handled=1;
*data=nl(*data);
}
-
+
if(filter(*data,"a=StartTime:integer;",&buf)) {
desc->start_time=atoi(buf);
handled=1;
@@ -218,7 +218,7 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
lprintf("mlti_data_size: %i\n", desc->mlti_data_size);
}
}
-
+
if(filter(*data,"a=ASMRuleBook:string;",&buf)) {
desc->asm_rule_book=strdup(buf);
handled=1;
@@ -238,7 +238,7 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
xine_buffer_free(buf);
xine_buffer_free(decoded);
-
+
return desc;
}
@@ -256,7 +256,7 @@ sdpplin_t *sdpplin_parse(char *data) {
while (data && *data) {
handled=0;
-
+
if (filter(data, "m=", &buf)) {
if ( ! desc->stream ) {
fprintf(stderr, "sdpplin.c: stream identifier found before stream count, skipping.");
@@ -279,7 +279,7 @@ sdpplin_t *sdpplin_parse(char *data) {
data=nl(data);
}
}
-
+
if(filter(data,"a=Author:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
if ( decoded != NULL ) {
@@ -288,7 +288,7 @@ sdpplin_t *sdpplin_parse(char *data) {
data=nl(data);
}
}
-
+
if(filter(data,"a=Copyright:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
if ( decoded != NULL ) {
@@ -297,7 +297,7 @@ sdpplin_t *sdpplin_parse(char *data) {
data=nl(data);
}
}
-
+
if(filter(data,"a=Abstract:buffer;",&buf)) {
decoded=b64_decode(buf, decoded, &len);
if ( decoded != NULL ) {
@@ -306,7 +306,7 @@ sdpplin_t *sdpplin_parse(char *data) {
data=nl(data);
}
}
-
+
if(filter(data,"a=StreamCount:integer;",&buf)) {
/* This way negative values are mapped to unfeasibly high
* values, and will be discarded afterward
@@ -340,7 +340,7 @@ sdpplin_t *sdpplin_parse(char *data) {
xine_buffer_free(buf);
xine_buffer_free(decoded);
-
+
return desc;
}
diff --git a/src/input/libreal/sdpplin.h b/src/input/libreal/sdpplin.h
index 1604ee38c..2296c31e7 100644
--- a/src/input/libreal/sdpplin.h
+++ b/src/input/libreal/sdpplin.h
@@ -19,7 +19,7 @@
*
* sdp/sdpplin parser.
*/
-
+
#ifndef HAVE_SDPPLIN_H
#define HAVE_SDPPLIN_H
@@ -98,7 +98,7 @@ typedef struct {
int duration;
sdpplin_stream_t **stream;
-
+
} sdpplin_t;
sdpplin_t *sdpplin_parse(char *data) XINE_MALLOC;