]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tcp.c
add size param to write_generic_desc
[ffmpeg] / libavformat / tcp.c
index 7672d25ca3a30fa6649af7c57953d19db68b065f..b81ab93cfc374a694dcd8f6c4432b59b6f947f21 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * TCP protocol
- * Copyright (c) 2002 Fabrice Bellard.
+ * Copyright (c) 2002 Fabrice Bellard
  *
  * This file is part of FFmpeg.
  *
@@ -22,6 +22,9 @@
 #include <unistd.h>
 #include "network.h"
 #include "os_support.h"
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 #include <sys/time.h>
 
 typedef struct TCPContext {
@@ -38,7 +41,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
     int fd_max, ret;
     struct timeval tv;
     socklen_t optlen;
-    char hostname[1024],proto[1024],path[1024],tmp[1024],*q;
+    char hostname[1024],proto[1024],path[1024];
 
     if(!ff_network_init())
         return AVERROR(EIO);
@@ -47,7 +50,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
         &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); }
 
     dest_addr.sin_family = AF_INET;
     dest_addr.sin_port = htons(port);