mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Cosmetics after previous patches.
Originally committed as revision 14926 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
8b9af28da4
commit
a3303add3c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user