Skip to content

Commit

Permalink
bluray + file protocol need decode path
Browse files Browse the repository at this point in the history
(cherry picked from commit cd49ee96a2215594a2dce726d0ba225da2e159ff)
  • Loading branch information
debugly committed Dec 17, 2024
1 parent c12e1ce commit ec93cfc
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 11fc8207f0a6c1857e009dc6048feb65c0e5fb1d Mon Sep 17 00:00:00 2001
From e6fdbabaf8902e834a745705c851db193b8d553f Mon Sep 17 00:00:00 2001
From: qianlongxu <[email protected]>
Date: Sat, 12 Oct 2024 19:05:14 +0800
Date: Tue, 17 Dec 2024 18:59:49 +0800
Subject: [PATCH 21] custom bluray fs for network Blu-ray Disc and BDMV

---
libavformat/Makefile | 2 +-
libavformat/bluray.c | 31 ++-
libavformat/bluray.c | 32 ++-
libavformat/bluray_custom_fs.c | 413 +++++++++++++++++++++++++++++++++
libavformat/bluray_custom_fs.h | 29 +++
4 files changed, 467 insertions(+), 8 deletions(-)
4 files changed, 468 insertions(+), 8 deletions(-)
create mode 100644 libavformat/bluray_custom_fs.c
create mode 100644 libavformat/bluray_custom_fs.h

Expand All @@ -26,7 +26,7 @@ index 427c45a..ffc32b9 100644
OBJS-$(CONFIG_CONCAT_PROTOCOL) += concat.o
OBJS-$(CONFIG_CONCATF_PROTOCOL) += concat.o
diff --git a/libavformat/bluray.c b/libavformat/bluray.c
index bf5b88d..62c7727 100644
index bf5b88d..96a799a 100644
--- a/libavformat/bluray.c
+++ b/libavformat/bluray.c
@@ -21,21 +21,22 @@
Expand Down Expand Up @@ -73,19 +73,20 @@ index bf5b88d..62c7727 100644
{
#ifdef DEBUG_BLURAY
bd_set_debug_mask(BLURAY_DEBUG_MASK);
@@ -138,11 +139,27 @@ static int bluray_open(URLContext *h, const char *path, int flags)
@@ -138,11 +139,28 @@ static int bluray_open(URLContext *h, const char *path, int flags)

av_strstart(path, BLURAY_PROTO_PREFIX, &diskname);

- bd->bd = bd_open(diskname, NULL);
+ fs_access *access = NULL;
+
+ diskname = ff_urldecode(diskname, 0);
+
+ if (av_strstart(diskname, "file://", NULL) || av_strstart(diskname, "/", NULL)) {
+ access = NULL;
+ } else {
+ //set read packet buffer size is important! the default packet size is 32768, when use smb2 protocol, download speed is limited to 2MB; but when set the size to 1048576, download speed is 16MB;
+ h->max_packet_size = 1048576;
+ diskname = ff_urldecode(diskname, 0);
+ access = create_bluray_custom_access(diskname, options);
+ }
+
Expand All @@ -102,7 +103,7 @@ index bf5b88d..62c7727 100644

/* check if disc can be played */
if (check_disc_info(h) < 0) {
@@ -321,7 +338,7 @@ fail:
@@ -321,7 +339,7 @@ fail:
const URLProtocol ff_bluray_protocol = {
.name = "bluray",
.url_close = bluray_close,
Expand Down Expand Up @@ -566,5 +567,5 @@ index 0000000..806fe29
+fs_access * create_bluray_custom_access(const char *url, AVDictionary **options);
+#endif /* bluray_custom_fs_smb2_h */
--
2.39.3 (Apple Git-146)
2.39.5 (Apple Git-154)

0 comments on commit ec93cfc

Please sign in to comment.