diff mbox series

[FFmpeg-devel,2/5] Fix up IPNS support.

Message ID 20220131135116.14035-3-markg85@gmail.com
State New
Headers show
Series Add IPFS and IPNS protocol support | expand

Checks

Context Check Description
andriy/commit_msg_x86 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_fate_x86 success Make fate finished
andriy/make_x86 warning New warnings during build
andriy/commit_msg_ppc warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".
andriy/make_fate_ppc success Make fate finished
andriy/make_ppc warning New warnings during build

Commit Message

Mark Gaiser Jan. 31, 2022, 1:51 p.m. UTC
Signed-off-by: Mark Gaiser <markg85@gmail.com>
---
 configure            |  1 +
 libavformat/Makefile |  1 +
 libavformat/ipfs.c   | 12 ++++++------
 3 files changed, 8 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer Jan. 31, 2022, 4 p.m. UTC | #1
On Mon, Jan 31, 2022 at 02:51:13PM +0100, Mark Gaiser wrote:
> Signed-off-by: Mark Gaiser <markg85@gmail.com>
> ---
>  configure            |  1 +
>  libavformat/Makefile |  1 +
>  libavformat/ipfs.c   | 12 ++++++------
>  3 files changed, 8 insertions(+), 6 deletions(-)

as with other fixes they should be stashed in the patch that contains the bug

thx

[...]
diff mbox series

Patch

diff --git a/configure b/configure
index e466f924a3..6ff09e7974 100755
--- a/configure
+++ b/configure
@@ -3586,6 +3586,7 @@  udplite_protocol_select="network"
 unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
 ipfs_protocol_select="https_protocol"
+ipns_protocol_select="https_protocol"
 
 # external library protocols
 libamqp_protocol_deps="librabbitmq"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 983a77f4f2..ed5a7ffc98 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -657,6 +657,7 @@  OBJS-$(CONFIG_SUBFILE_PROTOCOL)          += subfile.o
 OBJS-$(CONFIG_TEE_PROTOCOL)              += teeproto.o tee_common.o
 OBJS-$(CONFIG_TCP_PROTOCOL)              += tcp.o
 OBJS-$(CONFIG_IPFS_PROTOCOL)             += ipfs.o
+OBJS-$(CONFIG_IPNS_PROTOCOL)             += ipfs.o
 TLS-OBJS-$(CONFIG_GNUTLS)                += tls_gnutls.o
 TLS-OBJS-$(CONFIG_LIBTLS)                += tls_libtls.o
 TLS-OBJS-$(CONFIG_MBEDTLS)               += tls_mbedtls.o
diff --git a/libavformat/ipfs.c b/libavformat/ipfs.c
index 4cc65750ed..8daf032dd2 100644
--- a/libavformat/ipfs.c
+++ b/libavformat/ipfs.c
@@ -57,7 +57,7 @@  static int ipfs_open(URLContext *h, const char *uri, int flags, AVDictionary **o
         goto err;
     }
     
-    char* ipfs_gateway = "https://ipfs.io/ipfs/";
+    char* ipfs_gateway = "http://localhost:8080/";
     
     c->fulluri = malloc(strlen(ipfs_gateway)+strlen(gatewaysuffix) + 1);
     
@@ -191,12 +191,12 @@  const URLProtocol ff_ipfs_protocol = {
     .priv_data_class     = &ipfs_context_class,
 };
 
-const URLProtocol ff_infs_protocol = {
+const URLProtocol ff_ipns_protocol = {
     .name                = "ipns",
-    .url_open2           = ipfs_open,
-    .url_read            = ipfs_read,
-    .url_seek            = ipfs_seek,
-    .url_close           = ipfs_close,
+    .url_open2           = ipns_open,
+    .url_read            = ipns_read,
+    .url_seek            = ipns_seek,
+    .url_close           = ipns_close,
     .priv_data_size      = sizeof(Context),
     .priv_data_class     = &ipfs_context_class,
 };