[libbluray-devel] Fix caching

hpi1 git at videolan.org
Wed Mar 23 11:45:07 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Mar 21 10:50:55 2016 +0200| [9e7a76b5a7f8b4263644b6d8a6e4b265738ab822] | committer: hpi1

Fix caching

Make sure directories exist in cache.
Fixes Gozilla loading animation when played from UDF filesystem
(Xlet checks if directories / files exist).

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=9e7a76b5a7f8b4263644b6d8a6e4b265738ab822
---

 src/libbluray/bdj/java/org/videolan/VFSCache.java |    3 ++-
 src/libbluray/disc/disc.c                         |    5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/org/videolan/VFSCache.java b/src/libbluray/bdj/java/org/videolan/VFSCache.java
index 22fe1f0..04bacb5 100644
--- a/src/libbluray/bdj/java/org/videolan/VFSCache.java
+++ b/src/libbluray/bdj/java/org/videolan/VFSCache.java
@@ -295,7 +295,8 @@ class VFSCache {
         String relPath = absPath.substring(vfsRootLength);
         String[] names = Libbluray.listBdFiles(relPath, true);
         if (names != null) {
-            /* this is directory */
+            /* this is directory. Make sure it exists. */
+            Libbluray.cacheBdRomFile(relPath + "/", cacheRoot + relPath + "/");
             return;
         }
 
diff --git a/src/libbluray/disc/disc.c b/src/libbluray/disc/disc.c
index 4cff450..290e90f 100644
--- a/src/libbluray/disc/disc.c
+++ b/src/libbluray/disc/disc.c
@@ -454,6 +454,11 @@ int disc_cache_bdrom_file(BD_DISC *p, const char *rel_path, const char *cache_pa
     BD_FILE_H *fp_out;
     int64_t    got;
 
+    if (rel_path[strlen(rel_path) - 1] == '/') {
+        file_mkdirs(cache_path);
+        return 0;
+    }
+
     /* input file from BD-ROM */
     fp_in = p->pf_file_open_bdrom(p->fs_handle, rel_path);
     if (!fp_in) {



More information about the libbluray-devel mailing list