[libbluray-devel] Simplify

hpi1 git at videolan.org
Mon Jan 26 08:56:18 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Jan 25 17:47:54 2015 +0200| [adc56fc7c8d325b62c8916645ded3f1c7ba0a1bd] | committer: hpi1

Simplify

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

 src/libbluray/bdj/bdj.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index e1c1adb..ee4e3cc 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -266,20 +266,19 @@ static const char *_bdj_persistent_root(BDJ_STORAGE *storage)
     const char *root;
     char       *data_home;
 
-    if (storage->persistent_root) {
-        return storage->persistent_root;
-    }
+    if (!storage->persistent_root) {
 
-    root = getenv("LIBBLURAY_PERSISTENT_ROOT");
-    if (root) {
-        return root;
-    }
+        root = getenv("LIBBLURAY_PERSISTENT_ROOT");
+        if (root) {
+            return root;
+        }
 
         data_home = file_get_data_home();
         storage->persistent_root = str_printf("%s/bluray/dvb.persistent.root/", data_home ? data_home : "");
         X_FREE(data_home);
 
         BD_DEBUG(DBG_BDJ, "LIBBLURAY_PERSISTENT_ROOT not set, using %s\n", storage->persistent_root);
+    }
 
     return storage->persistent_root;
 }
@@ -289,20 +288,19 @@ static const char *_bdj_buda_root(BDJ_STORAGE *storage)
     const char *root;
     char       *cache_home;
 
-    if (storage->cache_root) {
-        return storage->cache_root;
-    }
+    if (!storage->cache_root) {
 
-    root = getenv("LIBBLURAY_CACHE_ROOT");
-    if (root) {
-        return root;
-    }
+        root = getenv("LIBBLURAY_CACHE_ROOT");
+        if (root) {
+            return root;
+        }
 
         cache_home = file_get_cache_home();
         storage->cache_root = str_printf("%s/bluray/bluray.bindingunit.root/", cache_home ? cache_home : "");
         X_FREE(cache_home);
 
         BD_DEBUG(DBG_BDJ, "LIBBLURAY_CACHE_ROOT not set, using %s\n", storage->cache_root);
+    }
 
     return storage->cache_root;
 }



More information about the libbluray-devel mailing list