diff vm/vm.c @ 397:a70f79850e5f src

implement and export dvdnav_get_serial_string(); patch by Matthew Wire devel - mrwire - co - uk. Fixed by Erik
author nicodvb
date Mon, 02 Feb 2009 22:55:58 +0000
parents 9c5aef10d165
children 61edd6fa781b
line wrap: on
line diff
--- a/vm/vm.c	Mon Jan 12 12:10:32 2009 +0000
+++ b/vm/vm.c	Mon Feb 02 22:55:58 2009 +0000
@@ -156,7 +156,7 @@
 }
 #endif
 
-static void dvd_read_name(char *name, const char *device) {
+static void dvd_read_name(char *name, char *serial, const char *device) {
     /* Because we are compiling with _FILE_OFFSET_BITS=64
      * all off_t are 64bit.
      */
@@ -192,6 +192,8 @@
               fprintf(MSG_OUT, " ");
             }
           }
+          strncpy(serial, (char*) &data[73], (i-73));
+          serial[14] = 0;
           fprintf(MSG_OUT, "\nlibdvdnav: DVD Title (Alternative): ");
           for(i=89; i < 128; i++ ) {
             if((data[i] == 0)) break;
@@ -352,7 +354,7 @@
       fprintf(MSG_OUT, "libdvdnav: vm: failed to open/read the DVD\n");
       return 0;
     }
-    dvd_read_name(vm->dvd_name, dvdroot);
+    dvd_read_name(vm->dvd_name, vm->dvd_serial, dvdroot);
     vm->map  = remap_loadmap(vm->dvd_name);
     vm->vmgi = ifoOpenVMGI(vm->dvd);
     if(!vm->vmgi) {