[MPlayer-cvslog] r31119 - branches/1.0rc3/stream/realrtsp/real.c
siretart
subversion at mplayerhq.hu
Sat May 1 20:31:21 CEST 2010
Author: siretart
Date: Sat May 1 20:31:21 2010
New Revision: 31119
Log:
M-x whitespace-cleanup
Modified:
branches/1.0rc3/stream/realrtsp/real.c
Modified: branches/1.0rc3/stream/realrtsp/real.c
==============================================================================
--- branches/1.0rc3/stream/realrtsp/real.c Sat May 1 20:30:01 2010 (r31118)
+++ branches/1.0rc3/stream/realrtsp/real.c Sat May 1 20:31:21 2010 (r31119)
@@ -98,18 +98,18 @@ static void real_calc_response_and_check
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 *
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+=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(cha
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,18 +252,18 @@ static rmff_header_t *real_parse_sdp(cha
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,
- desc->stream[i]->avg_bit_rate,
- desc->stream[i]->max_packet_size,
- desc->stream[i]->avg_packet_size,
- desc->stream[i]->start_time,
- desc->stream[i]->preroll,
- desc->stream[i]->duration,
- desc->stream[i]->stream_name,
- desc->stream[i]->mime_type,
+ desc->stream[i]->max_bit_rate,
+ desc->stream[i]->avg_bit_rate,
+ desc->stream[i]->max_packet_size,
+ desc->stream[i]->avg_packet_size,
+ desc->stream[i]->start_time,
+ desc->stream[i]->preroll,
+ desc->stream[i]->duration,
+ desc->stream[i]->stream_name,
+ desc->stream[i]->mime_type,
len,
buf);
@@ -276,7 +276,7 @@ static rmff_header_t *real_parse_sdp(cha
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 */
@@ -336,7 +336,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_sess
* (old code was: eof on the first eof packet received).
*/
if(flags1 & 0x7c) // ignore eof for streams with id != 0
- return 0;
+ return 0;
mp_msg(MSGT_STREAM, MSGL_INFO, "realrtsp: Stream EOF detected\n");
return -1;
}
@@ -360,13 +360,13 @@ int real_get_rdt_chunk(rtsp_t *rtsp_sess
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",
- ts, size, flags1, unknown1, header[4], header[5]);
+ 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_sess
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
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
/* 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");
@@ -506,7 +506,7 @@ autherr:
char *alert=rtsp_search_answers(rtsp_session,"Alert");
if (alert) {
mp_msg(MSGT_STREAM, MSGL_WARN, "realrtsp: got message from server:\n%s\n",
- alert);
+ alert);
}
rtsp_send_ok(rtsp_session);
buf = xbuffer_free(buf);
@@ -523,7 +523,7 @@ autherr:
// as size is unsigned this also catches the case (size < 0)
if (size > MAX_DESC_BUF) {
mp_msg(MSGT_STREAM, MSGL_ERR, "realrtsp: Content-length for description too big (> %uMB)!\n",
- MAX_DESC_BUF/(1024*1024) );
+ MAX_DESC_BUF/(1024*1024) );
xbuffer_free(buf);
return NULL;
}
@@ -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
{
if (!real_session)
return;
-
+
xbuffer_free (real_session->recv);
free (real_session);
}
More information about the MPlayer-cvslog
mailing list