[FFmpeg-cvslog] r14926 - trunk/libavformat/tcp.c
rbultje
subversion
Sat Aug 23 20:52:26 CEST 2008
Author: rbultje
Date: Sat Aug 23 20:52:26 2008
New Revision: 14926
Log:
Cosmetics after previous patches.
Modified:
trunk/libavformat/tcp.c
Modified: trunk/libavformat/tcp.c
==============================================================================
--- trunk/libavformat/tcp.c (original)
+++ trunk/libavformat/tcp.c Sat Aug 23 20:52:26 2008
@@ -32,27 +32,23 @@ typedef struct TCPContext {
static int tcp_open(URLContext *h, const char *uri, int flags)
{
struct sockaddr_in dest_addr;
- char hostname[1024], *q;
int port, fd = -1;
TCPContext *s = NULL;
fd_set wfds;
int fd_max, ret;
struct timeval tv;
socklen_t optlen;
- char proto[1024],path[1024],tmp[1024];
+ char hostname[1024],proto[1024],path[1024],tmp[1024],*q;
if(!ff_network_init())
return AVERROR(EIO);
url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
- &port, path, sizeof(path), uri);
- if (strcmp(proto,"tcp"))
+ &port, path, sizeof(path), uri);
+ if (strcmp(proto,"tcp") || port <= 0 || port >= 65536)
return AVERROR(EINVAL);
if ((q = strchr(hostname,'@'))) { strcpy(tmp,q+1); strcpy(hostname,tmp); }
- if (port <= 0 || port >= 65536)
- return AVERROR(EINVAL);
-
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(port);
if (resolve_host(&dest_addr.sin_addr, hostname) < 0)
More information about the ffmpeg-cvslog
mailing list