Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Unified Diff: patched-ffmpeg-mt/libavformat/avio.c

Issue 789004: ffmpeg roll of source to mar 9 version... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: patched-ffmpeg-mt/libavformat/avio.c
===================================================================
--- patched-ffmpeg-mt/libavformat/avio.c (revision 41250)
+++ patched-ffmpeg-mt/libavformat/avio.c (working copy)
@@ -26,6 +26,9 @@
#include "libavcodec/opt.h"
#include "os_support.h"
#include "avformat.h"
+#if CONFIG_NETWORK
+#include "network.h"
+#endif
#if LIBAVFORMAT_VERSION_MAJOR >= 53
/** @name Logging context. */
@@ -76,6 +79,10 @@
URLContext *uc;
int err;
+#if CONFIG_NETWORK
+ if (!ff_network_init())
+ return AVERROR(EIO);
+#endif
uc = av_mallocz(sizeof(URLContext) + strlen(filename) + 1);
if (!uc) {
err = AVERROR(ENOMEM);
@@ -93,8 +100,7 @@
err = up->url_open(uc, filename, flags);
if (err < 0) {
av_free(uc);
- *puc = NULL;
- return err;
+ goto fail;
}
//We must be careful here as url_seek() could be slow, for example for http
@@ -106,6 +112,9 @@
return 0;
fail:
*puc = NULL;
+#if CONFIG_NETWORK
+ ff_network_close();
+#endif
return err;
}
@@ -204,6 +213,9 @@
if (h->prot->url_close)
ret = h->prot->url_close(h);
+#if CONFIG_NETWORK
+ ff_network_close();
+#endif
av_free(h);
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698