1- From dd3692c5f2b6eb587c0853de3b7f9b6f0b30dc6a Mon Sep 17 00:00:00 2001
1+ From eddc99cb17ff667656a38cda644eb239910574a5 Mon Sep 17 00:00:00 2001
22From: qianlongxu <
[email protected] >
3- Date: Mon, 4 Nov 2024 14:47:57 +0800
3+ Date: Mon, 4 Nov 2024 15:27:00 +0800
44Subject: [PATCH 20] add built-in smb2 protocol via libsmb2
55
66---
@@ -62,7 +62,7 @@ index ae952eb..427c45a 100644
6262 OBJS-$(CONFIG_LIBZMQ_PROTOCOL) += libzmq.o
6363diff --git a/libavformat/libsmb2.c b/libavformat/libsmb2.c
6464new file mode 100644
65- index 0000000..741014c
65+ index 0000000..5fa1ba4
6666--- /dev/null
6767+++ b/libavformat/libsmb2.c
6868@@ -0,0 +1,412 @@
@@ -88,7 +88,7 @@ index 0000000..741014c
8888+
8989+
9090+ #include <fcntl.h>
91- +
91+ + #include <errno.h>
9292+ #include "libavutil/avstring.h"
9393+ #include "libavutil/opt.h"
9494+ #include "libavutil/avstring.h"
@@ -311,7 +311,7 @@ index 0000000..741014c
311311+ if (bytes_read > 0)
312312+ av_application_did_io_tcp_read(libsmb2->app_ctx, (void*)h, bytes_read);
313313+
314- + return bytes_read ? bytes_read : (has_error ? AVERROR(NOTCONN ) : AVERROR_EOF);
314+ + return bytes_read ? bytes_read : (has_error ? AVERROR(ENOTCONN ) : AVERROR_EOF);
315315+ }
316316+
317317+ static int libsmb2_write(URLContext *h, const unsigned char *buf, int size)
@@ -477,7 +477,7 @@ index 0000000..741014c
477477+ .priv_data_size = sizeof(LIBSMB2Context),
478478+ .priv_data_class = &libsmb2lient_context_class,
479479+ .flags = URL_PROTOCOL_FLAG_NETWORK,
480- + }
480+ + };
481481\ No newline at end of file
482482diff --git a/libavformat/protocols.c b/libavformat/protocols.c
483483index 73df344..2bda874 100644
0 commit comments