old mode 100644
new mode 100755
@@ -72,7 +72,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
char buf[256];
int ret;
char hostname[1024],proto[1024],path[1024];
- char portstr[10];
+ char portstr[64];
s->open_timeout = 5000000;
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
@@ -105,7 +105,19 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
}
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
- snprintf(portstr, sizeof(portstr), "%d", port);
+
+ switch (port) {
+ case 80:
+ snprintf(portstr, sizeof(portstr), "%s", "http");
+ break;
+ case 1935:
+ snprintf(portstr, sizeof(portstr), "%s", "macromedia-fcs"); //know as rtmp
+ break;
+ default:
+ snprintf(portstr, sizeof(portstr), "%d", port);
+ break;
+ }
+
if (s->listen)
hints.ai_flags |= AI_PASSIVE;
if (!hostname[0])
@@ -268,3 +280,4 @@ const URLProtocol ff_tcp_protocol = {
.flags = URL_PROTOCOL_FLAG_NETWORK,
.priv_data_class = &tcp_class,
};
+