summaryrefslogtreecommitdiffstats
path: root/stream/realrtsp/real.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/realrtsp/real.c')
-rw-r--r--stream/realrtsp/real.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/stream/realrtsp/real.c b/stream/realrtsp/real.c
index 6a7ef4e47b..9f01a5dfb0 100644
--- a/stream/realrtsp/real.c
+++ b/stream/realrtsp/real.c
@@ -98,18 +98,18 @@ static void real_calc_response_and_checksum (char *response, char *chksum, char
if (ch_len == 40) /* what a hack... */
ch_len=32;
if ( ch_len > 56 ) ch_len=56;
-
+
/* copy challenge to buf */
memcpy(buf+8, challenge, ch_len);
memset(buf+8+ch_len, 0, 56-ch_len);
}
-
+
/* xor challenge bytewise with xor_table */
for (i=0; i<XOR_TABLE_SIZE; i++)
buf[8+i] ^= xor_table[i];
av_md5_sum(zres, buf, 64);
-
+
/* convert zres to ascii string */
for (i=0; i<16; i++ )
sprintf(response+i*2, "%02x", zres[i]);
@@ -133,7 +133,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')
@@ -174,13 +174,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=AV_RB32(mlti_chunk);
mlti_chunk+=size+4;
}
-
+
size=AV_RB32(mlti_chunk);
#ifdef LOG
@@ -205,14 +205,14 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
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 = xbuffer_init(2048);
header=calloc(1,sizeof(rmff_header_t));
@@ -252,7 +252,7 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
buf = NULL;
} 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,
@@ -276,7 +276,7 @@ static rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t b
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 */
@@ -360,13 +360,13 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer, int rdt_rawdata) {
n=rtsp_read_data(rtsp_session, header, 6);
if (n<6) return 0;
ts=AV_RB32(header);
-
+
#ifdef LOG
- printf("ts: %u, size: %u, flags: 0x%02x, unknown values: 0x%06x 0x%02x 0x%02x\n",
+ printf("ts: %u, size: %u, flags: 0x%02x, unknown values: 0x%06x 0x%02x 0x%02x\n",
ts, size, flags1, unknown1, header[4], header[5]);
#endif
size+=2;
-
+
ph.object_version=0;
ph.length=size;
ph.stream_number=(flags1>>1)&0x1f;
@@ -388,7 +388,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer, int rdt_rawdata) {
rmff_dump_pheader(&ph, *buffer);
size-=12;
n=rtsp_read_data(rtsp_session, (*buffer)+12, size);
-
+
return (n <= 0) ? 0 : n+12;
}
@@ -435,7 +435,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidt
uint32_t maxbandwidth = bandwidth;
char* authfield = NULL;
int i;
-
+
/* get challenge */
challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
#ifdef LOG
@@ -445,7 +445,7 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidt
/* set a reasonable default to get the best stream, unless bandwidth given */
if (!bandwidth)
bandwidth = 10485800;
-
+
/* request stream description */
rtsp_send_describe:
rtsp_schedule_field(rtsp_session, "Accept: application/sdp");
@@ -532,7 +532,7 @@ autherr:
mp_msg(MSGT_STREAM, MSGL_WARN, "realrtsp: got no ETag!\n");
else
session_id=strdup(rtsp_search_answers(rtsp_session,"ETag"));
-
+
#ifdef LOG
printf("real: Stream description size: %u\n", size);
#endif
@@ -560,7 +560,7 @@ autherr:
printf("Title: %s\nCopyright: %s\nAuthor: %s\nStreams: %i\n",
h->cont->title, h->cont->copyright, h->cont->author, h->prop->num_streams);
#endif
-
+
/* setup our streams */
real_calc_response_and_checksum (challenge2, checksum, challenge1);
buf = xbuffer_ensure_size(buf, strlen(challenge2) + strlen(checksum) + 32);
@@ -638,7 +638,7 @@ free_real_rtsp_session (struct real_rtsp_session_t* real_session)
{
if (!real_session)
return;
-
+
xbuffer_free (real_session->recv);
free (real_session);
}