]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/gopher.c
lavf: move ff_put_str16_nolen from asf to avio and rename it
[ffmpeg] / libavformat / gopher.c
index abd1cc394a3962608c28e11c8c4a8671470d2863..b528f9bbbf85266dec70abeb710957df52398ef1 100644 (file)
 
 #include "libavutil/avstring.h"
 #include "avformat.h"
+#include "internal.h"
 #include "network.h"
 
 typedef struct {
     URLContext *hd;
 } GopherContext;
 
-static int gopher_write(URLContext *h, uint8_t *buf, int size)
+static int gopher_write(URLContext *h, const uint8_t *buf, int size)
 {
     GopherContext *s = h->priv_data;
     return url_write(s->hd, buf, size);
@@ -89,13 +90,13 @@ static int gopher_open(URLContext *h, const char *uri, int flags)
     h->priv_data = s;
 
     /* needed in any case to build the host string */
-    url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
-              path, sizeof(path), uri);
+    av_url_split(NULL, 0, auth, sizeof(auth), hostname, sizeof(hostname), &port,
+                 path, sizeof(path), uri);
 
     if (port < 0)
         port = 70;
 
-    snprintf(buf, sizeof(buf), "tcp://%s:%d", hostname, port);
+    ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
 
     s->hd = NULL;
     err = url_open(&s->hd, buf, URL_RDWR);