[libbluray-devel] Use user filesystem handler with libaacs

hpi1 git at videolan.org
Sun Dec 11 15:25:47 CET 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Dec 11 16:14:41 2011 +0200| [c5e9f910c5ce7de84985eb160490b078d1a5513e] | committer: hpi1

Use user filesystem handler with libaacs

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

 ChangeLog              |    1 +
 src/file/file.h        |    2 ++
 src/file/file_posix.c  |    5 +++++
 src/libbluray/bluray.c |    6 ++++++
 4 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f17b7c7..efa4cf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 ????-??-??:
+ - Use user filesystem handler with libaacs
  - Fixes to HDMV menu rendering
  - Optimized HDMV menu rendering
  - Support for sound effects in HDMV menus
diff --git a/src/file/file.h b/src/file/file.h
index ae78c15..3714d76 100644
--- a/src/file/file.h
+++ b/src/file/file.h
@@ -44,6 +44,8 @@
 
 BD_PRIVATE extern BD_FILE_H* (*file_open)(const char* filename, const char *mode);
 
+BD_PRIVATE BD_FILE_OPEN file_open_default(void);
+
 /*
  * directory access
  */
diff --git a/src/file/file_posix.c b/src/file/file_posix.c
index 654c442..20e30ef 100644
--- a/src/file/file_posix.c
+++ b/src/file/file_posix.c
@@ -110,3 +110,8 @@ static BD_FILE_H *file_open_linux(const char* filename, const char *mode)
 }
 
 BD_FILE_H* (*file_open)(const char* filename, const char *mode) = file_open_linux;
+
+BD_FILE_OPEN file_open_default(void)
+{
+    return file_open_linux;
+}
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 1ad36d0..d88e4a2 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -631,6 +631,12 @@ static int _libaacs_load(BLURAY *bd)
         if (bd->libaacs_open && bd->libaacs_decrypt_unit) {
             BD_DEBUG(DBG_BLURAY, "Loaded libaacs (%p)\n", bd->h_libaacs);
             bd->disc_info.libaacs_detected = 1;
+
+            if (file_open != file_open_default()) {
+                BD_DEBUG(DBG_BLURAY, "Registering libaacs filesystem handler %p (%p)\n", file_open, bd->h_libaacs);
+                DL_CALL(bd->h_libaacs, aacs_register_file, file_open);
+            }
+
             return 1;
 
         } else {



More information about the libbluray-devel mailing list