]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/gopher.c
Combine deprecation guards where appropriate
[ffmpeg] / libavformat / gopher.c
index 0543878ba8d8ee6971d41b05d7dc6dbba6ff70f8..6d9fc38d8c49d2bbea757e4b777dd056c1444c67 100644 (file)
@@ -28,7 +28,7 @@
 #include "network.h"
 #include "url.h"
 
-typedef struct {
+typedef struct GopherContext {
     URLContext *hd;
 } GopherContext;
 
@@ -94,7 +94,7 @@ static int gopher_open(URLContext *h, const char *uri, int flags)
 
     s->hd = NULL;
     err = ffurl_open(&s->hd, buf, AVIO_FLAG_READ_WRITE,
-                     &h->interrupt_callback, NULL);
+                     &h->interrupt_callback, NULL, h->protocols, h);
     if (err < 0)
         goto fail;
 
@@ -114,11 +114,12 @@ static int gopher_read(URLContext *h, uint8_t *buf, int size)
 }
 
 
-URLProtocol ff_gopher_protocol = {
-    .name      = "gopher",
-    .url_open  = gopher_open,
-    .url_read  = gopher_read,
-    .url_write = gopher_write,
-    .url_close = gopher_close,
+const URLProtocol ff_gopher_protocol = {
+    .name           = "gopher",
+    .url_open       = gopher_open,
+    .url_read       = gopher_read,
+    .url_write      = gopher_write,
+    .url_close      = gopher_close,
     .priv_data_size = sizeof(GopherContext),
+    .flags          = URL_PROTOCOL_FLAG_NETWORK,
 };