From 0eb321bf2c1cc0e048faff26a01f86cdd3ec254f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 7 Jul 2009 02:26:13 +0300 Subject: Remove trailing whitespace from most files --- stream/realrtsp/asmrp.c | 37 +++++++++++++++--------------- stream/realrtsp/real.c | 38 +++++++++++++++---------------- stream/realrtsp/real.h | 2 +- stream/realrtsp/rmff.c | 58 +++++++++++++++++++++++------------------------ stream/realrtsp/rmff.h | 10 ++++---- stream/realrtsp/sdpplin.c | 29 ++++++++++++------------ stream/realrtsp/sdpplin.h | 2 +- stream/realrtsp/xbuffer.c | 6 ++--- stream/realrtsp/xbuffer.h | 2 +- 9 files changed, 91 insertions(+), 93 deletions(-) (limited to 'stream/realrtsp') diff --git a/stream/realrtsp/asmrp.c b/stream/realrtsp/asmrp.c index d5dcbae003..aafe76719c 100644 --- a/stream/realrtsp/asmrp.c +++ b/stream/realrtsp/asmrp.c @@ -6,7 +6,7 @@ * Copyright (C) 2002 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 @@ -83,7 +83,7 @@ typedef struct { int sym; int num; - + char str[ASMRP_MAX_ID]; /* private part */ @@ -113,7 +113,7 @@ static void asmrp_dispose (asmrp_t *p) { int i; - for (i=0; isym_tab_num; i++) + for (i=0; isym_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); } @@ -169,10 +169,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; } @@ -193,7 +193,7 @@ static void asmrp_identifier (asmrp_t *p) { asmrp_getch (p); } p->str[l]=0; - + p->sym = ASMRP_SYM_ID; } @@ -397,10 +397,10 @@ static int asmrp_set_id (asmrp_t *p, char *s, int v) { printf ("new symbol '%s'\n", s); #endif - } + } p->sym_tab[i].v = v; - + #ifdef LOG printf ("symbol '%s' assigned %d\n", s, v); #endif @@ -413,7 +413,7 @@ static int asmrp_condition (asmrp_t *p) ; static int asmrp_operand (asmrp_t *p) { int i, ret; - + #ifdef LOG printf ("operand\n"); #endif @@ -425,7 +425,7 @@ static int asmrp_operand (asmrp_t *p) { case ASMRP_SYM_DOLLAR: asmrp_get_sym (p); - + if (p->sym != ASMRP_SYM_ID) { mp_msg(MSGT_STREAM, MSGL_ERR, "error: identifier expected.\n"); break; @@ -466,7 +466,7 @@ static int asmrp_operand (asmrp_t *p) { #ifdef LOG printf ("operand done, =%d\n", ret); #endif - + return ret; } @@ -520,7 +520,7 @@ static int asmrp_comp_expression (asmrp_t *p) { } static int asmrp_condition (asmrp_t *p) { - + int a; #ifdef LOG @@ -579,7 +579,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)) { mp_msg(MSGT_STREAM, MSGL_ERR, "error: number or string expected\n"); return; @@ -592,7 +592,7 @@ static void asmrp_assignment (asmrp_t *p) { } static int asmrp_rule (asmrp_t *p) { - + int ret; #ifdef LOG @@ -600,16 +600,16 @@ static int asmrp_rule (asmrp_t *p) { #endif 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); } @@ -687,4 +687,3 @@ int asmrp_match (const char *rules, int bandwidth, int *matches) { return num_matches; } - 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; istream[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); } diff --git a/stream/realrtsp/real.h b/stream/realrtsp/real.h index 0569a3db74..40e59c7c23 100644 --- a/stream/realrtsp/real.h +++ b/stream/realrtsp/real.h @@ -26,7 +26,7 @@ * adopted from joschkas real tools. * */ - + #ifndef MPLAYER_REAL_H #define MPLAYER_REAL_H diff --git a/stream/realrtsp/rmff.c b/stream/realrtsp/rmff.c index 5bfa086bb8..c4430de145 100644 --- a/stream/realrtsp/rmff.c +++ b/stream/realrtsp/rmff.c @@ -140,7 +140,7 @@ static int rmff_dump_mdpr(rmff_mdpr_t *mdpr, char *buffer, int bufsize) { buffer[41+s1] = mdpr->mime_type_size; s2=mdpr->mime_type_size; memcpy(&buffer[42+s1], mdpr->mime_type, s2); - + AV_WB32(buffer+42+s1+s2, mdpr->type_specific_len); s3=mdpr->type_specific_len; memcpy(&buffer[46+s1+s2], mdpr->type_specific_data, s3); @@ -161,7 +161,7 @@ static int rmff_dump_cont(rmff_cont_t *cont, char *buffer, int bufsize) { AV_WB32(buffer, cont->object_id); AV_WB32(buffer+4, cont->size); AV_WB16(buffer+8, cont->object_version); - + AV_WB16(buffer+10, cont->title_len); memcpy(&buffer[12], cont->title, cont->title_len); p=12+cont->title_len; @@ -225,7 +225,7 @@ int rmff_dump_header(rmff_header_t *h, char *buffer, int max) { stream++; } } - + if ((size=rmff_dump_dataheader(h->data, &buffer[written], max)) < 0) goto buftoosmall; written+=size; @@ -318,22 +318,22 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data) { mdpr->start_time=AV_RB32(&data[28]); mdpr->preroll=AV_RB32(&data[32]); mdpr->duration=AV_RB32(&data[36]); - + mdpr->stream_name_size=data[40]; mdpr->stream_name=malloc(mdpr->stream_name_size+1); 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]; mdpr->mime_type=malloc(mdpr->mime_type_size+1); 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=AV_RB32(&data[42+mdpr->stream_name_size+mdpr->mime_type_size]); mdpr->type_specific_data=malloc(mdpr->type_specific_len); - 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; } @@ -390,7 +390,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)); @@ -414,21 +414,21 @@ rmff_header_t *rmff_scan_header(const char *data) { } header->fileheader=rmff_scan_fileheader(ptr); ptr += header->fileheader->size; - + header->streams=malloc(sizeof(rmff_mdpr_t*)*(header->fileheader->num_headers)); for (i=0; ifileheader->num_headers; i++) { header->streams[i]=NULL; } - + for (i=1; ifileheader->num_headers; i++) { chunk_type = AV_RB32(ptr); - + if (ptr[0] == 0) { mp_msg(MSGT_STREAM, MSGL_WARN, "rmff: warning: only %d of %d header found.\n", i, header->fileheader->num_headers); break; } - + chunk_size=1; switch (chunk_type) { case PROP_TAG: @@ -552,7 +552,7 @@ rmff_prop_t *rmff_new_prop ( prop->data_offset=data_offset; prop->num_streams=num_streams; prop->flags=flags; - + return prop; } @@ -571,7 +571,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; @@ -597,7 +597,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; @@ -614,7 +614,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; @@ -653,11 +653,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; @@ -716,7 +716,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) { @@ -744,7 +744,7 @@ void rmff_fix_header(rmff_header_t *h) { streams++; } } - + if (h->prop) { if (h->prop->size != 50) { @@ -784,7 +784,7 @@ void rmff_fix_header(rmff_header_t *h) { } num_headers++; - + if (!h->fileheader) { #ifdef LOG printf("rmff_fix_header: no fileheader, creating one"); @@ -801,7 +801,7 @@ void rmff_fix_header(rmff_header_t *h) { if(h->fileheader->num_headers != num_headers) { #ifdef LOG - printf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers); + printf("rmff_fix_header: setting num_headers from %i to %i\n", h->fileheader->num_headers, num_headers); #endif h->fileheader->num_headers=num_headers; } @@ -809,26 +809,26 @@ void rmff_fix_header(rmff_header_t *h) { if(h->prop) { if (h->prop->data_offset != header_size) { #ifdef LOG - printf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size); + printf("rmff_fix_header: setting prop.data_offset from %i to %i\n", h->prop->data_offset, header_size); #endif 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); #ifdef LOG - printf("rmff_fix_header: assuming prop.num_packets=%i\n", p); + printf("rmff_fix_header: assuming prop.num_packets=%i\n", p); #endif h->prop->num_packets=p; } if (h->data->num_packets == 0) { #ifdef LOG - printf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets); + printf("rmff_fix_header: assuming data.num_packets=%i\n", h->prop->num_packets); #endif h->data->num_packets=h->prop->num_packets; } - + #ifdef LOG - printf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size); + printf("rmff_fix_header: assuming data.size=%i\n", h->prop->num_packets*h->prop->avg_packet_size); #endif h->data->size=h->prop->num_packets*h->prop->avg_packet_size; } @@ -840,7 +840,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/stream/realrtsp/rmff.h b/stream/realrtsp/rmff.h index 3699723f9b..00b6b58ce9 100644 --- a/stream/realrtsp/rmff.h +++ b/stream/realrtsp/rmff.h @@ -107,7 +107,7 @@ typedef struct { uint32_t data_offset; uint16_t num_streams; uint16_t flags; - + } rmff_prop_t; typedef struct { @@ -150,11 +150,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; @@ -187,7 +187,7 @@ typedef struct { /* * constructors for header structs */ - + rmff_fileheader_t *rmff_new_fileheader(uint32_t num_headers); rmff_prop_t *rmff_new_prop ( @@ -256,7 +256,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 to . is the size of */ diff --git a/stream/realrtsp/sdpplin.c b/stream/realrtsp/sdpplin.c index 80dc49edaa..5d68d4f397 100644 --- a/stream/realrtsp/sdpplin.c +++ b/stream/realrtsp/sdpplin.c @@ -25,7 +25,7 @@ * sdp/sdpplin parser. * */ - + #include "config.h" #include "stream/librtsp/rtsp.h" #include "sdpplin.h" @@ -62,7 +62,7 @@ static char *b64_decode(const char *in, char *out, int *size) dtable['='] = 0; k=0; - + /*CONSTANTCONDITION*/ for (j=0; jstream_id=atoi(buf); handled=1; @@ -178,7 +178,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { handled=1; *data=nl(*data); } - + if(filter(*data,"a=StartTime:integer;",&buf)) { desc->start_time=atoi(buf); handled=1; @@ -222,7 +222,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { printf("mlti_data_size: %i\n", desc->mlti_data_size); #endif } - + if(filter(*data,"a=ASMRuleBook:string;",&buf)) { desc->asm_rule_book=strdup(buf); handled=1; @@ -250,7 +250,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { xbuffer_free(buf); xbuffer_free(decoded); - + return desc; } @@ -273,7 +273,7 @@ sdpplin_t *sdpplin_parse(char *data) { #endif handled=0; - + if (filter(data, "m=", &buf)) { sdpplin_stream_t *stream=sdpplin_parse_stream(&data); #ifdef LOG @@ -306,28 +306,28 @@ sdpplin_t *sdpplin_parse(char *data) { handled=1; data=nl(data); } - + if(filter(data,"a=Author:buffer;",&buf)) { decoded=b64_decode(buf, decoded, &len); desc->author=strdup(decoded); handled=1; data=nl(data); } - + if(filter(data,"a=Copyright:buffer;",&buf)) { decoded=b64_decode(buf, decoded, &len); desc->copyright=strdup(decoded); handled=1; data=nl(data); } - + if(filter(data,"a=Abstract:buffer;",&buf)) { decoded=b64_decode(buf, decoded, &len); desc->abstract=strdup(decoded); handled=1; data=nl(data); } - + if(filter(data,"a=StreamCount:integer;",&buf)) { desc->stream_count=(unsigned int)atoi(buf); desc->stream=calloc(desc->stream_count, sizeof(sdpplin_stream_t*)); @@ -355,7 +355,7 @@ sdpplin_t *sdpplin_parse(char *data) { xbuffer_free(buf); xbuffer_free(decoded); - + return desc; } @@ -393,4 +393,3 @@ void sdpplin_free(sdpplin_t *description) { free(description); } - diff --git a/stream/realrtsp/sdpplin.h b/stream/realrtsp/sdpplin.h index 658aeaf0ed..770a6cb8e1 100644 --- a/stream/realrtsp/sdpplin.h +++ b/stream/realrtsp/sdpplin.h @@ -98,7 +98,7 @@ typedef struct { int duration; sdpplin_stream_t **stream; - + } sdpplin_t; sdpplin_t *sdpplin_parse(char *data); diff --git a/stream/realrtsp/xbuffer.c b/stream/realrtsp/xbuffer.c index de68125ef1..6b408d68bb 100644 --- a/stream/realrtsp/xbuffer.c +++ b/stream/realrtsp/xbuffer.c @@ -1,4 +1,4 @@ -/* +/* * xbuffer code * * Includes a minimalistic replacement for xine_buffer functions used in @@ -28,7 +28,7 @@ typedef struct { -void *xbuffer_init(int chunk_size) { +void *xbuffer_init(int chunk_size) { uint8_t *data=calloc(1,chunk_size+XBUFFER_HEADER_SIZE); xbuffer_header_t *header=(xbuffer_header_t*)data; @@ -75,7 +75,7 @@ void *xbuffer_ensure_size(void *buf, int size) { } xbuf = ((xbuffer_header_t*)(((uint8_t*)buf)-XBUFFER_HEADER_SIZE)); - + if (xbuf->size < size) { new_size = size + xbuf->chunk_size - (size % xbuf->chunk_size); xbuf->size = new_size; diff --git a/stream/realrtsp/xbuffer.h b/stream/realrtsp/xbuffer.h index f311290d7e..695aa2e23f 100644 --- a/stream/realrtsp/xbuffer.h +++ b/stream/realrtsp/xbuffer.h @@ -1,4 +1,4 @@ -/* +/* * xbuffer code * * Includes a minimalistic replacement for xine_buffer functions used in -- cgit v1.2.3