[libbluray-devel] Fixed bdj_test

hpi1 git at videolan.org
Fri May 6 10:59:08 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri May  6 11:55:09 2011 +0300| [aff71735bcd7bc864c6e5d31b328310979ef9ba5] | committer: hpi1

Fixed bdj_test

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

 src/examples/bdj_test.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/examples/bdj_test.c b/src/examples/bdj_test.c
index dedd8b2..ceedb87 100644
--- a/src/examples/bdj_test.c
+++ b/src/examples/bdj_test.c
@@ -36,23 +36,28 @@ void usage(void) {
     printf("Usage: [path to disc] [starting object]\n");
 }
 
-int main(int argc, char** argv) {
-    printf("%s %s\n", argv[1], argv[2]);
+int main(int argc, char** argv)
+{
     if (argc < 3) {
         usage();
         return 0;
     }
 
+    printf("%s %s\n", argv[1], argv[2]);
+
     BLURAY* bd = bd_open(argv[1], NULL);
 
     bd_get_titles(bd, TITLES_ALL);
     bd_select_title(bd, 1);
 
-    if (bd_start_bdj(bd, argv[2]))
+    if (!bd_start_bdj(bd, argv[2])) {
         printf("Failed to start BD-J application.\n");
-    else {
+    } else {
         while (1) { sleep(20); }
         bd_stop_bdj(bd);
     }
+
+    bd_close(bd);
+
     return 0;
 }



More information about the libbluray-devel mailing list