diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-29 19:36:58 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-05-29 19:36:58 +0000 |
commit | 85cbbc35304f4af162ab4de8b128b71d30dfcadd (patch) | |
tree | 0319aad339e596a1f267992bd116afa71c2a1980 /libmpdemux | |
parent | a2a8724a9330d59f6e5fa1130ac6ad26bbe146a6 (diff) | |
download | mpv-85cbbc35304f4af162ab4de8b128b71d30dfcadd.tar.bz2 mpv-85cbbc35304f4af162ab4de8b128b71d30dfcadd.tar.xz |
Using recv/send instead read/write for proper MinGW support (it's a 4.2BSD standard). Patch by FloDt <flodt8@yahoo.de>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10207 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/asf_mmst_streaming.c | 10 | ||||
-rw-r--r-- | libmpdemux/asf_streaming.c | 4 | ||||
-rw-r--r-- | libmpdemux/netstream.h | 4 | ||||
-rw-r--r-- | libmpdemux/network.c | 6 | ||||
-rw-r--r-- | libmpdemux/pnm.c | 4 | ||||
-rw-r--r-- | libmpdemux/realrtsp/rmff.c | 4 | ||||
-rw-r--r-- | libmpdemux/realrtsp/rtsp.c | 4 |
7 files changed, 18 insertions, 18 deletions
diff --git a/libmpdemux/asf_mmst_streaming.c b/libmpdemux/asf_mmst_streaming.c index fd0ecbf994..0e6b27ec59 100644 --- a/libmpdemux/asf_mmst_streaming.c +++ b/libmpdemux/asf_mmst_streaming.c @@ -90,7 +90,7 @@ static void send_command (int s, int command, uint32_t switches, memcpy (&cmd.buf[48], data, length); - if (write (s, cmd.buf, length+48) != (length+48)) { + if (send (s, cmd.buf, length+48, 0) != (length+48)) { printf ("write error\n"); } } @@ -118,7 +118,7 @@ static void get_answer (int s) while (command == 0x1b) { int len; - len = read (s, data, BUF_SIZE) ; + len = recv (s, data, BUF_SIZE, 0) ; if (!len) { printf ("\nalert! eof\n"); return; @@ -138,7 +138,7 @@ static int get_data (int s, char *buf, size_t count) while (total < count) { - len = read (s, &buf[total], count-total); + len = recv (s, &buf[total], count-total, 0); if (len<0) { perror ("read error:"); @@ -460,7 +460,7 @@ int asf_mmst_streaming_start(stream_t *stream) // send_command(s, commandno ....) send_command (s, 1, 0, 0x0004000b, strlen(str) * 2+8, data); - len = read (s, data, BUF_SIZE) ; + len = recv (s, data, BUF_SIZE, 0) ; /*This sends details of the local machine IP address to a Funnel system at the server. * Also, the TCP or UDP transport selection is sent. @@ -475,7 +475,7 @@ int asf_mmst_streaming_start(stream_t *stream) memset (data, 0, 8); send_command (s, 2, 0, 0, 28*2+8, data); - len = read (s, data, BUF_SIZE) ; + len = recv (s, data, BUF_SIZE, 0) ; /* This command sends file path (at server) and file name request to the server. * 0x5 */ diff --git a/libmpdemux/asf_streaming.c b/libmpdemux/asf_streaming.c index 0e3eaf8cdb..4fbe5fbda1 100644 --- a/libmpdemux/asf_streaming.c +++ b/libmpdemux/asf_streaming.c @@ -656,7 +656,7 @@ asf_http_streaming_start( stream_t *stream, int *demuxer_type ) { http_hdr = asf_http_request( stream->streaming_ctrl ); mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request [%s]\n", http_hdr->buffer ); for(i=0; i < (int)http_hdr->buffer_size ; ) { - int r = write( fd, http_hdr->buffer+i, http_hdr->buffer_size-i ); + int r = send( fd, http_hdr->buffer+i, http_hdr->buffer_size-i, 0 ); if(r <0) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Socket write error : %s\n",strerror(errno)); return -1; @@ -666,7 +666,7 @@ asf_http_streaming_start( stream_t *stream, int *demuxer_type ) { http_free( http_hdr ); http_hdr = http_new_header(); do { - i = read( fd, buffer, BUFFER_SIZE ); + i = recv( fd, buffer, BUFFER_SIZE, 0 ); //printf("read: %d\n", i ); if( i<=0 ) { perror("read"); diff --git a/libmpdemux/netstream.h b/libmpdemux/netstream.h index b505027b02..f13d80f1ca 100644 --- a/libmpdemux/netstream.h +++ b/libmpdemux/netstream.h @@ -45,7 +45,7 @@ typedef struct mp_net_stream_opened_st { static int net_read(int fd, char* buf, int len) { int r = 0; while(len) { - r = read(fd,buf,len); + r = recv(fd,buf,len,0); if(r <= 0) { if(errno == EINTR) continue; if(r < 0) @@ -95,7 +95,7 @@ static mp_net_stream_packet_t* read_packet(int fd) { static int net_write(int fd, char* buf, int len) { int w; while(len) { - w = write(fd,buf,len); + w = send(fd,buf,len,0); if(w <= 0) { if(errno == EINTR) continue; if(w < 0) diff --git a/libmpdemux/network.c b/libmpdemux/network.c index b09effa647..46d77be2ae 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -428,7 +428,7 @@ http_send_request( URL_t *url ) { } mp_msg(MSGT_NETWORK,MSGL_DBG2,"Request: [%s]\n", http_hdr->buffer ); - ret = write( fd, http_hdr->buffer, http_hdr->buffer_size ); + ret = send( fd, http_hdr->buffer, http_hdr->buffer_size, 0 ); if( ret!=(int)http_hdr->buffer_size ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Error while sending HTTP request: didn't sent all the request\n"); return -1; @@ -451,7 +451,7 @@ http_read_response( int fd ) { } do { - i = read( fd, response, BUFFER_SIZE ); + i = recv( fd, response, BUFFER_SIZE, 0 ); if( i<0 ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Read failed\n"); http_free( http_hdr ); @@ -794,7 +794,7 @@ nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctr if( len<size ) { int ret; - ret = read( fd, buffer+len, size-len ); + ret = recv( fd, buffer+len, size-len, 0 ); if( ret<0 ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"nop_streaming_read error : %s\n",strerror(errno)); } diff --git a/libmpdemux/pnm.c b/libmpdemux/pnm.c index bf79a32920..c5368f2f98 100644 --- a/libmpdemux/pnm.c +++ b/libmpdemux/pnm.c @@ -202,7 +202,7 @@ static int rm_write(int s, const char *buf, int len) { while (total < len){ int n; - n = write (s, &buf[total], len - total); + n = send (s, &buf[total], len - total, 0); if (n > 0) total += n; @@ -238,7 +238,7 @@ static ssize_t rm_read(int fd, void *buf, size_t count) { return -1; } - ret=read (fd, ((uint8_t*)buf)+total, count-total); + ret=recv (fd, ((uint8_t*)buf)+total, count-total, 0); if (ret<=0) { printf ("input_pnm: read error.\n"); diff --git a/libmpdemux/realrtsp/rmff.c b/libmpdemux/realrtsp/rmff.c index 00ac565b08..0a5d65f984 100644 --- a/libmpdemux/realrtsp/rmff.c +++ b/libmpdemux/realrtsp/rmff.c @@ -502,7 +502,7 @@ rmff_header_t *rmff_scan_header_stream(int fd) { do { buf = xbuffer_ensure_size(buf, index+8); - read(fd, buf+index, 8); + recv(fd, buf+index, 8, 0); chunk_type=BE_32(buf+index); index+=4; chunk_size=BE_32(buf+index); index+=4; @@ -514,7 +514,7 @@ rmff_header_t *rmff_scan_header_stream(int fd) { case RMF_TAG: case PROP_TAG: buf = xbuffer_ensure_size(buf, index+chunk_size-8); - read(fd, buf+index, (chunk_size-8)); + recv(fd, buf+index, (chunk_size-8), 0); index+=(chunk_size-8); break; default: diff --git a/libmpdemux/realrtsp/rtsp.c b/libmpdemux/realrtsp/rtsp.c index 428c35f68e..153104f99a 100644 --- a/libmpdemux/realrtsp/rtsp.c +++ b/libmpdemux/realrtsp/rtsp.c @@ -158,7 +158,7 @@ static int write_stream(int s, const char *buf, int len) { while (total < len){ int n; - n = write (s, &buf[total], len - total); + n = send (s, &buf[total], len - total, 0); if (n > 0) total += n; @@ -181,7 +181,7 @@ static ssize_t read_stream(int fd, void *buf, size_t count) { while (total < count) { - ret=read (fd, ((uint8_t*)buf)+total, count-total); + ret=recv (fd, ((uint8_t*)buf)+total, count-total, 0); if (ret<0) { if(errno == EAGAIN) { |