diff options
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 67005e3eca..418a8a79fc 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -127,7 +127,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, int err; #if CONFIG_NETWORK - if (!ff_network_init()) + if (up->flags & URL_PROTOCOL_FLAG_NETWORK && !ff_network_init()) return AVERROR(EIO); #endif uc = av_mallocz(sizeof(URLContext) + strlen(filename) + 1); @@ -181,7 +181,8 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, fail: *puc = NULL; #if CONFIG_NETWORK - ff_network_close(); + if (up->flags & URL_PROTOCOL_FLAG_NETWORK) + ff_network_close(); #endif return err; } @@ -409,7 +410,8 @@ int ffurl_close(URLContext *h) if (h->is_connected && h->prot->url_close) ret = h->prot->url_close(h); #if CONFIG_NETWORK - ff_network_close(); + if (h->prot->flags & URL_PROTOCOL_FLAG_NETWORK) + ff_network_close(); #endif if (h->prot->priv_data_size) { if (h->prot->priv_data_class) |