diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-05-13 02:58:57 +0000 |
commit | 6e9cbdc10448203e7c8b2de41447442fcc9f7bae (patch) | |
tree | 0ed465592509105fdbeab27fc12ddbb2e3590aa5 /stream/asf_streaming.c | |
parent | eafe5b7517bbf408ae1ffc936a3abe2313c3b334 (diff) | |
download | mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.bz2 mpv-6e9cbdc10448203e7c8b2de41447442fcc9f7bae.tar.xz |
whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/asf_streaming.c')
-rw-r--r-- | stream/asf_streaming.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/stream/asf_streaming.c b/stream/asf_streaming.c index c3e70a4aa2..517bb49f52 100644 --- a/stream/asf_streaming.c +++ b/stream/asf_streaming.c @@ -53,7 +53,7 @@ static int asf_read_wrapper(int fd, void *buffer, int len, streaming_ctrl_t *str // internet connection, the TCP connection will not get // through // * Then we can try HTTP. -// +// // Note: Using WMP sequence MMSU then MMST and then HTTP. static int asf_streaming_start( stream_t *stream, int *demuxer_type) { @@ -82,7 +82,7 @@ static int asf_streaming_start( stream_t *stream, int *demuxer_type) { if( fd==-2 ) return -1; } - //Is protocol http, http_proxy, or mms? + //Is protocol http, http_proxy, or mms? if (!strcasecmp(proto, "http_proxy") || !strcasecmp(proto, "http") || !strcasecmp(proto, "mms") || !strcasecmp(proto, "mmsh") || !strcasecmp(proto, "mmshttp")) @@ -100,7 +100,7 @@ static int asf_streaming_start( stream_t *stream, int *demuxer_type) { } static int asf_streaming(ASF_stream_chunck_t *stream_chunck, int *drop_packet ) { -/* +/* printf("ASF stream chunck size=%d\n", stream_chunck->size); printf("length: %d\n", length ); printf("0x%02X\n", stream_chunck->type ); @@ -115,7 +115,7 @@ printf("0x%02X\n", stream_chunck->type ); mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_SizeConfirmMismatch, stream_chunck->size, stream_chunck->size_confirm); return -1; } -/* +/* printf(" type: 0x%02X\n", stream_chunck->type ); printf(" size: %d (0x%02X)\n", stream_chunck->size, stream_chunck->size ); printf(" sequence_number: 0x%04X\n", stream_chunck->sequence_number ); @@ -175,7 +175,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) int bw = streaming_ctrl->bandwidth; int *v_rates = NULL, *a_rates = NULL; int v_rate = 0, a_rate = 0, a_idx = -1, v_idx = -1; - + if(asf_ctrl == NULL) return -1; // The ASF header can be in several network chunks. For example if the content description @@ -196,7 +196,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_NoHeaderAtFirstChunk); return -1; } - + // audit: do not overflow buffer_size if (size > SIZE_MAX - buffer_size) return -1; buffer = malloc(size+buffer_size); @@ -211,7 +211,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) chunk_buffer = buffer; buffer += buffer_size; buffer_size += size; - + if (asf_read_wrapper(fd, buffer, size, streaming_ctrl) <= 0) return -1; @@ -227,9 +227,9 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) } while( buffer_size<chunk_size2read); buffer = chunk_buffer; size = buffer_size; - + start = sizeof(ASF_header_t); - + pos = find_asf_guid(buffer, asf_file_header_guid, start, size); if (pos >= 0) { ASF_file_header_t *fileh = (ASF_file_header_t *) &buffer[pos]; @@ -242,7 +242,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) } */ asf_ctrl->packet_size = AV_RL32(&fileh->max_packet_size); - // before playing. + // before playing. // preroll: time in ms to bufferize before playing streaming_ctrl->prebuffer_size = (unsigned int)(((double)fileh->preroll/1000.0)*((double)fileh->max_bitrate/8.0)); } @@ -289,7 +289,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) int stream_count; char *ptr = &buffer[pos]; char *end = &buffer[size]; - + mp_msg(MSGT_NETWORK, MSGL_V, "Stream bitrate properties object\n"); if (ptr + 2 > end) goto len_err_out; stream_count = AV_RL16(ptr); @@ -354,7 +354,7 @@ static int asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) // find best audio stream a_idx = max_idx(asf_ctrl->n_audio, a_rates, bw - v_rate); - + free(v_rates); free(a_rates); @@ -403,7 +403,7 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct if (rest == 0 && waiting == 0) { if (asf_read_wrapper(fd, &chunk, sizeof(ASF_stream_chunck_t), streaming_ctrl) <= 0) return -1; - + // Endian handling of the stream chunk le2me_ASF_stream_chunck_t(&chunk); chunk_size = asf_streaming( &chunk, &drop_chunk ); @@ -412,7 +412,7 @@ static int asf_http_streaming_read( int fd, char *buffer, int size, streaming_ct return -1; } chunk_size -= sizeof(ASF_stream_chunck_t); - + if(chunk.type != ASF_STREAMING_HEADER && (!drop_chunk)) { if (asf_http_ctrl->packet_size < chunk_size) { mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ErrChunkBiggerThanPacket); @@ -475,7 +475,7 @@ static int asf_http_streaming_type(char *content_type, char *features, HTTP_head if( !strcasecmp(content_type, "application/octet-stream") || !strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") || // New in Corona, first request !strcasecmp(content_type, "application/x-mms-framed") || // New in Corana, second request - !strcasecmp(content_type, "video/x-ms-asf")) { + !strcasecmp(content_type, "video/x-ms-asf")) { if( strstr(features, "broadcast") ) { mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Live stream\n"); @@ -560,10 +560,10 @@ static HTTP_header_t *asf_http_request(streaming_ctrl_t *streaming_ctrl) { http_set_uri( http_hdr, url->file ); sprintf( str, "Host: %.220s:%d", url->hostname, url->port ); } - + http_set_field( http_hdr, str ); http_set_field( http_hdr, "Pragma: xClientGUID={c77e7400-738a-11d2-9add-0020af0a3278}" ); - sprintf(str, + sprintf(str, "Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=%u:%u,request-context=%d,max-duration=%u", offset_hi, offset_lo, asf_http_ctrl->request, length ); http_set_field( http_hdr, str ); @@ -645,7 +645,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT char *comma_ptr=NULL; char *end; //printf("Pragma: [%s]\n", pragma ); - // The pragma line can get severals attributes + // The pragma line can get severals attributes // separeted with a comma ','. do { if( !strncasecmp( pragma, "features=", 9) ) { @@ -653,7 +653,7 @@ static int asf_http_parse_response(asf_http_streaming_ctrl_t *asf_http_ctrl, HTT end = strstr( pragma, "," ); if( end==NULL ) { len = strlen(pragma); - } else { + } else { len = (unsigned int)(end-pragma); } if(len > sizeof(features) - 1) { @@ -718,7 +718,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) { goto err_out; } i += r; - } + } http_free( http_hdr ); http_hdr = http_new_header(); do { @@ -783,7 +783,7 @@ static int asf_http_streaming_start( stream_t *stream, int *demuxer_type ) { mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_UnknownASFStreamingType); goto err_out; } - // Check if we got a redirect. + // Check if we got a redirect. } while(!done); stream->fd = fd; @@ -820,7 +820,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { url = url_new(stream->url); stream->streaming_ctrl->url = check4proxies(url); url_free(url); - + mp_msg(MSGT_OPEN, MSGL_INFO, MSGTR_MPDEMUX_ASF_InfoStreamASFURL, stream->url); if((!strncmp(stream->url, "http", 4)) && (*file_format!=DEMUXER_TYPE_ASF && *file_format!=DEMUXER_TYPE_UNKNOWN)) { streaming_ctrl_free(stream->streaming_ctrl); @@ -834,7 +834,7 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { stream->streaming_ctrl = NULL; return STREAM_UNSUPPORTED; } - + if (*file_format != DEMUXER_TYPE_PLAYLIST) *file_format = DEMUXER_TYPE_ASF; stream->type = STREAMTYPE_STREAM; |