libaacs | branch: master | npzacs <npz...@gmail.com> | Thu Feb 25 18:21:10 2016 
+0200| [262b1af900cb7f102406106af7ff0a616dc57bd4] | committer: npzacs

aacs_info: use aacs_init() + aacs_open_device()

> http://git.videolan.org/gitweb.cgi/libaacs.git/?a=commit;h=262b1af900cb7f102406106af7ff0a616dc57bd4
---

 src/examples/aacs_info.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/examples/aacs_info.c b/src/examples/aacs_info.c
index 8e88c92..ff78f73 100644
--- a/src/examples/aacs_info.c
+++ b/src/examples/aacs_info.c
@@ -1,6 +1,6 @@
 /*
  * This file is part of libaacs
- * Copyright (C) 2010  npzacs
+ * Copyright (C) 2010-2016  npzacs
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -89,6 +89,7 @@ static void _dump_rl(const char *type, AACS_RL_ENTRY *rl, int 
num_entries, int m
 int main (int argc, char **argv)
 {
     int major, minor, micro, error_code = AACS_SUCCESS;
+    AACS *aacs = NULL;
 
     if (argc < 2) {
         fprintf(stderr, "Usage: aacs_info <path-to-disc-root> 
[<path-to-config-file>]\n");
@@ -98,16 +99,19 @@ int main (int argc, char **argv)
     aacs_get_version(&major, &minor, &micro);
     printf("Opening %s using libaacs %d.%d.%d ...\n", argv[1], major, minor, 
micro);
 
-    AACS *aacs = aacs_open2(argv[1], argc > 2 ? argv[2] : NULL, &error_code);
+    aacs = aacs_init();
+    if (!aacs) {
+       exit(EXIT_FAILURE);
+    }
+
+    error_code = aacs_open_device(aacs, argv[1], argc > 2 ? argv[2] : NULL);
+
     if (error_code) {
         fprintf(stderr, "libaacs open failed: %s\n", _error_str(error_code));
     } else {
         printf("libaacs open succeed.\n");
     }
 
-    if (!aacs) {
-       exit(EXIT_FAILURE);
-    }
 
     const uint8_t *vid = aacs_get_vid(aacs);
     const uint8_t *mk  = aacs_get_mk(aacs);

_______________________________________________
libaacs-devel mailing list
libaacs-devel@videolan.org
https://mailman.videolan.org/listinfo/libaacs-devel

Reply via email to