[libbluray-devel] org.bluray.vfs.VFSManager: improve compatibility

hpi1 git at videolan.org
Fri Apr 15 12:25:26 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Apr 13 14:53:30 2016 +0300| [1b03bcdb8847613650c243909908598cd419d8a7] | committer: hpi1

org.bluray.vfs.VFSManager: improve compatibility

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

 src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java b/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java
index 4255488..a852f3d 100644
--- a/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java
+++ b/src/libbluray/bdj/java/org/bluray/vfs/VFSManager.java
@@ -27,14 +27,21 @@ import org.videolan.Logger;
 public class VFSManager {
 
     private static VFSManager instance = null;
+    private static final Object instanceLock = new Object();
 
     public static VFSManager getInstance() throws SecurityException,
             UnsupportedOperationException {
-        if (instance == null) {
-            instance = new VFSManager();
-        }
 
-        return instance;
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null)
+            sm.checkPermission(new VFSPermission("*"));
+
+        synchronized (instanceLock) {
+            if (instance == null) {
+                instance = new VFSManager();
+            }
+            return instance;
+        }
     }
 
     protected VFSManager() {
@@ -71,6 +78,7 @@ public class VFSManager {
 
         BUMFAsset[] assets = BUMFParser.parse(manifestfile);
         if (assets == null) {
+            logger.error("manifest parsing failed");
             state = STABLE;
             throw new PreparingFailedException();
         }



More information about the libbluray-devel mailing list