diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-06 20:30:34 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-06 20:30:34 +0000 |
commit | 403b791ab9f13e85ce9866f86749fc9267a315be (patch) | |
tree | e7035009081fc71d62c1216c3ef9cbf1bfc3f0db | |
parent | e5f0ff7cbfcf9b9143b14b3297bc9f8246fb343b (diff) | |
download | mpv-403b791ab9f13e85ce9866f86749fc9267a315be.tar.bz2 mpv-403b791ab9f13e85ce9866f86749fc9267a315be.tar.xz |
ehh. i forgot to commit this patch: fix RTP streaming. patch by Dave Chapman <dave@dchapman.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4554 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/network.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libmpdemux/network.c b/libmpdemux/network.c index 667c4174b6..d97dbca012 100644 --- a/libmpdemux/network.c +++ b/libmpdemux/network.c @@ -97,12 +97,12 @@ read_rtp_from_server(int fd, char *buffer, int length) { char *data; int len; static int got_first = 0; - static int sequence; + static unsigned short sequence; if( buffer==NULL || length<0 ) return -1; getrtp2(fd, &rh, &data, &len); - if( got_first && rh.b.sequence != sequence+1 ) + if( got_first && rh.b.sequence != (unsigned short)(sequence+1) ) printf("RTP packet sequence error! Expected: %d, received: %d\n", sequence+1, rh.b.sequence); got_first = 1; @@ -366,7 +366,7 @@ extension=NULL; printf("You must enter a port number for RTP streams!\n"); return -1; } - return -1; + return 0; } // Checking for ASF @@ -562,6 +562,7 @@ rtp_open_socket( URL_t *url ) { fd_set set; struct sockaddr_in server_address; struct ip_mreq mcast; + struct timeval tv; printf("Listening for traffic on %s:%d ...\n", url->hostname, url->port ); @@ -609,12 +610,12 @@ rtp_open_socket( URL_t *url ) { } } - //tv.tv_sec = 0; - //tv.tv_usec = (10 * 1000000); // 10 seconds timeout + tv.tv_sec = 0; + tv.tv_usec = (1 * 1000000); // 1 second timeout FD_ZERO( &set ); FD_SET( socket_server_fd, &set ); - //if( select(socket_server_fd+1, &set, NULL, NULL, &tv)>0 ) { - if( select(socket_server_fd+1, &set, NULL, NULL, NULL)>0 ) { + if( select(socket_server_fd+1, &set, NULL, NULL, &tv)>0 ) { + //if( select(socket_server_fd+1, &set, NULL, NULL, NULL)>0 ) { err_len = sizeof( err ); getsockopt( socket_server_fd, SOL_SOCKET, SO_ERROR, &err, &err_len ); if( err ) { |