Commit 0af686c5 authored by mstorsjo's avatar mstorsjo

Don't explicitly initialize networking in the tcp and udp protocols

Networking is always initialized when opening protocols.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22227 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 786bb080
...@@ -44,9 +44,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ...@@ -44,9 +44,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
char hostname[1024],proto[1024],path[1024]; char hostname[1024],proto[1024],path[1024];
char portstr[10]; char portstr[10];
if(!ff_network_init())
return AVERROR(EIO);
url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname), url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri); &port, path, sizeof(path), uri);
if (strcmp(proto,"tcp") || port <= 0 || port >= 65536) if (strcmp(proto,"tcp") || port <= 0 || port >= 65536)
...@@ -192,7 +189,6 @@ static int tcp_close(URLContext *h) ...@@ -192,7 +189,6 @@ static int tcp_close(URLContext *h)
{ {
TCPContext *s = h->priv_data; TCPContext *s = h->priv_data;
closesocket(s->fd); closesocket(s->fd);
ff_network_close();
av_free(s); av_free(s);
return 0; return 0;
} }
......
...@@ -320,9 +320,6 @@ static int udp_open(URLContext *h, const char *uri, int flags) ...@@ -320,9 +320,6 @@ static int udp_open(URLContext *h, const char *uri, int flags)
is_output = (flags & URL_WRONLY); is_output = (flags & URL_WRONLY);
if(!ff_network_init())
return AVERROR(EIO);
s = av_mallocz(sizeof(UDPContext)); s = av_mallocz(sizeof(UDPContext));
if (!s) if (!s)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
...@@ -482,7 +479,6 @@ static int udp_close(URLContext *h) ...@@ -482,7 +479,6 @@ static int udp_close(URLContext *h)
if (s->is_multicast && !(h->flags & URL_WRONLY)) if (s->is_multicast && !(h->flags & URL_WRONLY))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr); udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
closesocket(s->udp_fd); closesocket(s->udp_fd);
ff_network_close();
av_free(s); av_free(s);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment