[libbluray-devel] commit: _index_open(): check if already opened (hpi1 )

git at videolan.org git at videolan.org
Mon Oct 25 11:55:11 CEST 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Oct 18 16:00:05 2010 +0300| [2407d652f34f3ac31372383b3ad9e73645bec1c4] | committer: hpi1 

_index_open(): check if already opened

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

 src/libbluray/bluray.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index cf30e48..bb061ff 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -529,11 +529,13 @@ static void _libbdplus_open(BLURAY *bd, const char *keyfile_path)
 
 static int _index_open(BLURAY *bd)
 {
-    char *file;
+    if (!bd->index) {
+        char *file;
 
-    file = str_printf("%s/BDMV/index.bdmv", bd->device_path);
-    bd->index = indx_parse(file);
-    X_FREE(file);
+        file = str_printf("%s/BDMV/index.bdmv", bd->device_path);
+        bd->index = indx_parse(file);
+        X_FREE(file);
+    }
 
     return !!bd->index;
 }



More information about the libbluray-devel mailing list