[libbluray-devel] commit: Query vid from libaacs for libbdplus (hpi1 )

git at videolan.org git at videolan.org
Mon Dec 27 14:35:49 CET 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Dec 27 15:34:54 2010 +0200| [0e5902ff9a6f1e122a81cad2ee8707d00a39b58b] | committer: hpi1 

Query vid from libaacs for libbdplus

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

 src/libbluray/bluray.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 47ffbbf..707c88f 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -531,6 +531,25 @@ static int _libaacs_open(BLURAY *bd, const char *keyfile_path)
     return 0;
 }
 
+static uint8_t *_libaacs_get_vid(BLURAY *bd)
+{
+    if (bd->aacs) {
+#ifdef DLOPEN_CRYPTO_LIBS
+        fptr_p_void fptr = dl_dlsym(bd->h_libaacs, "aacs_get_vid");
+        if (fptr) {
+            return (uint8_t*)fptr(bd->aacs);
+        }
+        DEBUG(DBG_BLURAY, "aacs_get_vid() dlsym failed! (%p)", bd);
+        return NULL;
+#else
+        return aacs_get_vid(bd->aacs);
+#endif
+    }
+
+    DEBUG(DBG_BLURAY, "_libaacs_get_vid(): libaacs not initialized! (%p)", bd);
+    return NULL;
+}
+
 static void _libbdplus_close(BLURAY *bd)
 {
     if (bd->bdplus) {
@@ -643,7 +662,7 @@ static int _libbdplus_open(BLURAY *bd, const char *keyfile_path)
         return 0;
     }
 
-    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, vid);
+    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, _libaacs_get_vid(bd) ?: vid);
 
     if (bd->bdplus) {
         DEBUG(DBG_BLURAY,"libbdplus initialized\n");



More information about the libbluray-devel mailing list