diff -Naur libdvdread-0.9.4-orig/Makefile.in libdvdread-0.9.4/Makefile.in --- libdvdread-0.9.4-orig/Makefile.in 2003-02-22 14:38:35.000000000 -0800 +++ libdvdread-0.9.4/Makefile.in 2003-10-16 16:01:18.000000000 -0700 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.6.2 from Makefile.am. +# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 @@ -112,7 +112,8 @@ .SUFFIXES: -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile diff -Naur libdvdread-0.9.4-orig/dvdread/Makefile.am libdvdread-0.9.4/dvdread/Makefile.am --- libdvdread-0.9.4-orig/dvdread/Makefile.am 2003-02-13 13:33:38.000000000 -0800 +++ libdvdread-0.9.4/dvdread/Makefile.am 2003-10-16 15:59:20.000000000 -0700 @@ -3,7 +3,7 @@ lib_LTLIBRARIES = libdvdread.la libdvdread_la_SOURCES = dvd_input.c dvd_reader.c dvd_udf.c ifo_read.c \ ifo_print.c nav_read.c nav_print.c bswap.h dvd_udf.h dvd_input.h \ - dvdread_internal.h \ + dvdread_internal.h vm_print.c \ md5.c md5.h libdvdread_la_LIBADD = @DL_LIBS@ @CSS_LIBS@ libdvdread_la_LDFLAGS = -version-info 3:0:0 -export-symbols-regex "(DVD.*|ifo.*|nav.*)" @@ -11,4 +11,4 @@ pkgincludedir = $(includedir)/dvdread pkginclude_HEADERS = dvd_reader.h ifo_types.h ifo_read.h \ - ifo_print.h nav_types.h nav_read.h nav_print.h + ifo_print.h nav_types.h nav_read.h nav_print.h vm_print.h diff -Naur libdvdread-0.9.4-orig/dvdread/Makefile.in libdvdread-0.9.4/dvdread/Makefile.in --- libdvdread-0.9.4-orig/dvdread/Makefile.in 2003-02-22 14:39:25.000000000 -0800 +++ libdvdread-0.9.4/dvdread/Makefile.in 2003-10-16 16:01:18.000000000 -0700 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.6.2 from Makefile.am. +# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 @@ -93,14 +93,14 @@ lib_LTLIBRARIES = libdvdread.la libdvdread_la_SOURCES = dvd_input.c dvd_reader.c dvd_udf.c ifo_read.c \ ifo_print.c nav_read.c nav_print.c bswap.h dvd_udf.h dvd_input.h \ - dvdread_internal.h \ + dvdread_internal.h vm_print.c \ md5.c md5.h libdvdread_la_LIBADD = @DL_LIBS@ @CSS_LIBS@ libdvdread_la_LDFLAGS = -version-info 3:0:0 -export-symbols-regex "(DVD.*|ifo.*|nav.*)" pkginclude_HEADERS = dvd_reader.h ifo_types.h ifo_read.h \ - ifo_print.h nav_types.h nav_read.h nav_print.h + ifo_print.h nav_types.h nav_read.h nav_print.h vm_print.h subdir = dvdread mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -110,7 +110,8 @@ libdvdread_la_DEPENDENCIES = am_libdvdread_la_OBJECTS = dvd_input.lo dvd_reader.lo dvd_udf.lo \ - ifo_read.lo ifo_print.lo nav_read.lo nav_print.lo md5.lo + ifo_read.lo ifo_print.lo nav_read.lo nav_print.lo vm_print.lo \ + md5.lo libdvdread_la_OBJECTS = $(am_libdvdread_la_OBJECTS) DEFS = @DEFS@ @@ -124,7 +125,7 @@ @AMDEP_TRUE@ ./$(DEPDIR)/dvd_reader.Plo ./$(DEPDIR)/dvd_udf.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/ifo_print.Plo ./$(DEPDIR)/ifo_read.Plo \ @AMDEP_TRUE@ ./$(DEPDIR)/md5.Plo ./$(DEPDIR)/nav_print.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/nav_read.Plo +@AMDEP_TRUE@ ./$(DEPDIR)/nav_read.Plo ./$(DEPDIR)/vm_print.Plo COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ @@ -193,6 +194,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nav_print.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nav_read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vm_print.Plo@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) diff -Naur libdvdread-0.9.4-orig/dvdread/ifo_print.c libdvdread-0.9.4/dvdread/ifo_print.c --- libdvdread-0.9.4-orig/dvdread/ifo_print.c 2003-02-01 18:23:53.000000000 -0800 +++ libdvdread-0.9.4/dvdread/ifo_print.c 2003-10-16 16:00:14.000000000 -0700 @@ -30,6 +30,7 @@ #include "ifo_types.h" #include "ifo_read.h" #include "ifo_print.h" +#include "vm_print.h" #include "dvdread_internal.h" /* Put this in some other file / package? It's used in nav_print too. */ @@ -63,18 +64,9 @@ printf(" @ %s fps", rate); } -/* Put this in some other file / package? It's used in nav_print too. - Possibly also by the vm / navigator. */ static void ifoPrint_CMD(int row, vm_cmd_t *command) { - int i; - - printf("(%03d) ", row + 1); - for(i=0;i<8;i++) - printf("%02x ", command->bytes[i]); - printf("| "); - - //vmcmd(command); - printf("\n"); + printf( "(%03d) ", row + 1); + vmPrint_CMD(command); } static void ifoPrint_video_attributes(video_attr_t *attr) { diff -Naur libdvdread-0.9.4-orig/dvdread/nav_print.c libdvdread-0.9.4/dvdread/nav_print.c --- libdvdread-0.9.4-orig/dvdread/nav_print.c 2003-01-07 12:58:15.000000000 -0800 +++ libdvdread-0.9.4/dvdread/nav_print.c 2003-10-16 15:59:20.000000000 -0700 @@ -30,6 +30,7 @@ #include "nav_types.h" #include "nav_print.h" +#include "vm_print.h" #include "dvdread_internal.h" static void print_time(dvd_time_t *dtime) { @@ -167,7 +168,7 @@ printf("left %d, ", btni->left); printf("right %d\n", btni->right); - // ifoPrint_COMMAND(&btni->cmd); + vmPrint_CMD(&btni->cmd); printf("\n"); } } diff -Naur libdvdread-0.9.4-orig/dvdread/vm_print.c libdvdread-0.9.4/dvdread/vm_print.c --- libdvdread-0.9.4-orig/dvdread/vm_print.c 1969-12-31 16:00:00.000000000 -0800 +++ libdvdread-0.9.4/dvdread/vm_print.c 2003-10-16 15:59:20.000000000 -0700 @@ -0,0 +1,505 @@ +/* + * Copyright (C) 2000, 2001, 2002, 2003 + * Björn Englund , + * Håkan Hjort + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "vm_print.h" + +typedef struct +{ + uint8_t bits[8]; + uint8_t examined[8]; +} cmd_t; + +// Fix this.. pass as parameters instead. +static cmd_t cmd; + +static const char *cmp_op_table[] = { + NULL, "&", "==", "!=", ">=", ">", "<=", "<" +}; +static const char *set_op_table[] = { + NULL, "=", "<->", "+=", "-=", "*=", "/=", "%=", "rnd", "&=", "|=", "^=" +}; + +static const char *link_table[] = { + "LinkNoLink", "LinkTopC", "LinkNextC", "LinkPrevC", + NULL, "LinkTopPG", "LinkNextPG", "LinkPrevPG", + NULL, "LinkTopPGC", "LinkNextPGC", "LinkPrevPGC", + "LinkGoUpPGC", "LinkTailPGC", NULL, NULL, + "RSM" +}; + +static const char *system_reg_table[] = { + "Menu Description Language Code", + "Audio Stream Number", + "Sub-picture Stream Number", + "Angle Number", + "Title Track Number", + "VTS Title Track Number", + "VTS PGC Number", + "PTT Number for One_Sequential_PGC_Title", + "Highlighted Button Number", + "Navigation Timer", + "Title PGC Number for Navigation Timer", + "Audio Mixing Mode for Karaoke", + "Country Code for Parental Management", + "Parental Level", + "Player Configurations for Video", + "Player Configurations for Audio", + "Initial Language Code for Audio", + "Initial Language Code Extension for Audio", + "Initial Language Code for Sub-picture", + "Initial Language Code Extension for Sub-picture", + "Player Regional Code", + "Reserved 21", + "Reserved 22", + "Reserved 23" +}; + +static const char *system_reg_abbr_table[] = { + NULL, + "ASTN", + "SPSTN", + "AGLN", + "TTN", + "VTS_TTN", + "TT_PGCN", + "PTTN", + "HL_BTNN", + "NVTMR", + "NV_PGCN", + NULL, + "CC_PLT", + "PLT", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + + + +static uint32_t bits(int byte, int bit, int count) { + uint32_t val = 0; + int bit_mask; + + while(count--) { + if(bit > 7) { + bit = 0; + byte++; + } + bit_mask = 0x01 << (7-bit); + val <<= 1; + if((cmd.bits[byte]) & bit_mask) + val |= 1; + cmd.examined[byte] |= bit_mask; + bit++; + } + return val; +} + + +static void print_system_reg(uint16_t reg) { + if(reg < sizeof(system_reg_abbr_table) / sizeof(char *)) + printf( system_reg_table[reg]); + else + printf( " WARNING: Unknown system register "); +} + +static void print_reg(uint8_t reg) { + if(reg & 0x80) + print_system_reg(reg & 0x7f); + else + if(reg < 16) + printf( "g[%" PRIu8 "]", reg); + else + printf( " WARNING: Unknown general register "); +} + +static void print_cmp_op(uint8_t op) { + if(op < sizeof(cmp_op_table) / sizeof(char *) && cmp_op_table[op] != NULL) + printf( " %s ", cmp_op_table[op]); + else + printf( " WARNING: Unknown compare op "); +} + +static void print_set_op(uint8_t op) { + if(op < sizeof(set_op_table) / sizeof(char *) && set_op_table[op] != NULL) + printf( " %s ", set_op_table[op]); + else + printf( " WARNING: Unknown set op "); +} + +static void print_reg_or_data(int immediate, int byte) { + if(immediate) { + int i = bits(byte,0,16); + + printf( "0x%x", i); + if(isprint(i & 0xff) && isprint((i>>8) & 0xff)) + printf( " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff)); + } else { + print_reg(bits(byte + 1,0,8)); + } +} + +static void print_reg_or_data_2(int immediate, int byte) { + if(immediate) + printf( "0x%x", bits(byte,1,7)); + else + printf( "g[%" PRIu8 "]", bits(byte,4,4)); +} + +static void print_if_version_1(void) { + uint8_t op = bits(1,1,3); + + if(op) { + printf( "if ("); + print_reg(bits(3,0,8)); + print_cmp_op(op); + print_reg_or_data(bits(1,0,1), 4); + printf( ") "); + } +} + +static void print_if_version_2(void) { + uint8_t op = bits(1,1,3); + + if(op) { + printf( "if ("); + print_reg(bits(6,0,8)); + print_cmp_op(op); + print_reg(bits(7,0,8)); + printf( ") "); + } +} + +static void print_if_version_3(void) { + uint8_t op = bits(1,1,3); + + if(op) { + printf( "if ("); + print_reg(bits(2,4,4)); + print_cmp_op(op); + print_reg_or_data(bits(1,0,1), 6); + printf( ") "); + } +} + +static void print_if_version_4(void) { + uint8_t op = bits(1,1,3); + + if(op) { + printf( "if ("); + print_reg(bits(1,4,4)); + print_cmp_op(op); + print_reg_or_data(bits(1,0,1), 4); + printf( ") "); + } +} + +static void print_special_instruction(void) { + uint8_t op = bits(1,4,4); + + switch(op) { + case 0: // NOP + printf( "Nop"); + break; + case 1: // Goto line + printf( "Goto %" PRIu8, bits(7,0,8)); + break; + case 2: // Break + printf( "Break"); + break; + case 3: // Parental level + printf( "SetTmpPML %" PRIu8 ", Goto %" PRIu8, + bits(6,4,4), bits(7,0,8)); + break; + default: + printf( "WARNING: Unknown special instruction (%i)", + bits(1,4,4)); + } +} + +static void print_linksub_instruction(void) { + int linkop = bits(7,3,5); + int button = bits(6,0,6); + + if(linkop < sizeof(link_table)/sizeof(char *) && link_table[linkop] != NULL) + printf( "%s (button %" PRIu8 ")", link_table[linkop], button); + else + printf( "WARNING: Unknown linksub instruction (%i)", linkop); +} + +static void print_link_instruction(int optional) { + uint8_t op = bits(1,4,4); + + if(optional && op) + printf( ", "); + + switch(op) { + case 0: + if(!optional) + printf( "WARNING: NOP (link)!"); + break; + case 1: + print_linksub_instruction(); + break; + case 4: + printf( "LinkPGCN %" PRIu16, bits(6,1,15)); + break; + case 5: + printf( "LinkPTT %" PRIu16 " (button %" PRIu8 ")", + bits(6,6,10), bits(6,0,6)); + break; + case 6: + printf( "LinkPGN %" PRIu8 " (button %" PRIu8 ")", + bits(7,1,7), bits(6,0,6)); + break; + case 7: + printf( "LinkCN %" PRIu8 " (button %" PRIu8 ")", + bits(7,0,8), bits(6,0,6)); + break; + default: + printf( "WARNING: Unknown link instruction"); + } +} + +static void print_jump_instruction(void) { + switch(bits(1,4,4)) { + case 1: + printf( "Exit"); + break; + case 2: + printf( "JumpTT %" PRIu8, bits(5,1,7)); + break; + case 3: + printf( "JumpVTS_TT %" PRIu8, bits(5,1,7)); + break; + case 5: + printf( "JumpVTS_PTT %" PRIu8 ":%" PRIu16, + bits(5,1,7), bits(2,6,10)); + break; + case 6: + switch(bits(5,0,2)) { + case 0: + printf( "JumpSS FP"); + break; + case 1: + printf( "JumpSS VMGM (menu %" PRIu8 ")", bits(5,4,4)); + break; + case 2: + printf( "JumpSS VTSM (vts %" PRIu8 ", title %" PRIu8 + ", menu %" PRIu8 ")", bits(4,0,8), bits(3,0,8), bits(5,4,4)); + break; + case 3: + printf( "JumpSS VMGM (pgc %" PRIu8 ")", bits(2,1,15)); + break; + } + break; + case 8: + switch(bits(5,0,2)) { + case 0: + printf( "CallSS FP (rsm_cell %" PRIu8 ")", + bits(4,0,8)); + break; + case 1: + printf( "CallSS VMGM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", bits(5,4,4), bits(4,0,8)); + break; + case 2: + printf( "CallSS VTSM (menu %" PRIu8 + ", rsm_cell %" PRIu8 ")", bits(5,4,4), bits(4,0,8)); + break; + case 3: + printf( "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")", + bits(2,1,15), bits(4,0,8)); + break; + } + break; + default: + printf( "WARNING: Unknown Jump/Call instruction"); + } +} + +static void print_system_set(void) { + int i; + + switch(bits(0,4,4)) { + case 1: // Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) + for(i = 1; i <= 3; i++) { + if(bits(2+i,0,1)) { + print_system_reg(i); + printf( " = "); + print_reg_or_data_2(bits(0,3,1), 2 + i); + printf( " "); + } + } + break; + case 2: // Set system reg 9 & 10 (Navigation timer, Title PGC number) + print_system_reg(9); + printf( " = "); + print_reg_or_data(bits(0,3,1), 2); + printf( " "); + print_system_reg(10); + printf( " = %" PRIu8, bits(5,0,8)); // ?? + break; + case 3: // Mode: Counter / Register + Set + printf( "SetMode "); + if(bits(5,0,1)) + printf( "Counter "); + else + printf( "Register "); + print_reg(bits(5,4,4)); + print_set_op(0x1); // '=' + print_reg_or_data(bits(0,3,1), 2); + break; + case 6: // Set system reg 8 (Highlighted button) + print_system_reg(8); + if(bits(0,3,1)) // immediate + printf( " = 0x%x (button no %d)", bits(4,0,16), bits(4,0,6)); + else + printf( " = g[%" PRIu8 "]", bits(5,4,4)); + break; + default: + printf( "WARNING: Unknown system set instruction (%i)", + bits(0,4,4)); + } +} + +static void print_set_version_1(void) { + uint8_t set_op = bits(0,4,4); + + if(set_op) { + print_reg(bits(3,0,8)); + print_set_op(set_op); + print_reg_or_data(bits(0,3,1), 4); + } else { + printf( "NOP"); + } +} + +static void print_set_version_2(void) { + uint8_t set_op = bits(0,4,4); + + if(set_op) { + print_reg(bits(1,4,4)); + print_set_op(set_op); + print_reg_or_data(bits(0,3,1), 2); + } else { + printf( "NOP"); + } +} + +static void vmPrint_mnemonic(vm_cmd_t *command) { + int i, extra_bits; + + for(i = 0; i < 8; i++) { + cmd.bits[i] = command->bytes[i]; + cmd.examined[i] = 0; + } + + switch(bits(0,0,3)) { /* three first bits */ + case 0: // Special instructions + print_if_version_1(); + print_special_instruction(); + break; + case 1: // Jump/Call or Link instructions + if(bits(0,3,1)) { + print_if_version_2(); + print_jump_instruction(); + } else { + print_if_version_1(); + print_link_instruction(0); // must be pressent + } + break; + case 2: // Set System Parameters instructions + print_if_version_2(); + print_system_set(); + print_link_instruction(1); // either 'if' or 'link' + break; + case 3: // Set General Parameters instructions + print_if_version_3(); + print_set_version_1(); + print_link_instruction(1); // either 'if' or 'link' + break; + case 4: // Set, Compare -> LinkSub instructions + print_set_version_2(); + printf( ", "); + print_if_version_4(); + print_linksub_instruction(); + break; + case 5: // Compare -> (Set and LinkSub) instructions + print_if_version_4(); + printf( "{ "); + print_set_version_2(); + printf( ", "); + print_linksub_instruction(); + printf( " }"); + break; + case 6: // Compare -> Set, always LinkSub instructions + print_if_version_4(); + printf( "{ "); + print_set_version_2(); + printf( " } "); + print_linksub_instruction(); + break; + default: + printf( "WARNING: Unknown instruction type (%i)", bits(0,0,3)); + } + // Check if there still are bits set that were not examined + + extra_bits = 0; + for(i = 0; i < 8; i++) + if(cmd.bits[i] & ~ cmd.examined[i]) { + extra_bits = 1; + break; + } + if(extra_bits) { + printf( " [WARNING, unknown bits:"); + for(i = 0; i < 8; i++) + printf( " %02x", cmd.bits[i] & ~ cmd.examined[i]); + printf( "]"); + } +} + +void vmPrint_CMD(vm_cmd_t *command) { + int i; + + for(i = 0; i < 8; i++) + printf( "%02x ", command->bytes[i]); + printf( "| "); + + vmPrint_mnemonic(command); + printf( "\n"); +} + diff -Naur libdvdread-0.9.4-orig/dvdread/vm_print.h libdvdread-0.9.4/dvdread/vm_print.h --- libdvdread-0.9.4-orig/dvdread/vm_print.h 1969-12-31 16:00:00.000000000 -0800 +++ libdvdread-0.9.4/dvdread/vm_print.h 2003-10-16 15:59:37.000000000 -0700 @@ -0,0 +1,34 @@ +#ifndef VM_PRINT_H_INCLUDED +#define VM_PRINT_H_INCLUDED + +/* + * Copyright (C) 2000, 2001 Björn Englund , + * Håkan Hjort + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void vmPrint_COMMAND(vm_cmd_t *); + +#ifdef __cplusplus +}; +#endif +#endif /* VM_PRINT_H_INCLUDED */ diff -Naur libdvdread-0.9.4-orig/src/Makefile.am libdvdread-0.9.4/src/Makefile.am --- libdvdread-0.9.4-orig/src/Makefile.am 2003-01-12 07:21:20.000000000 -0800 +++ libdvdread-0.9.4/src/Makefile.am 2003-10-16 16:01:10.000000000 -0700 @@ -4,11 +4,14 @@ INCLUDES = -I$(top_srcdir) -noinst_PROGRAMS = ifo_dump play_title title_info disc_id +noinst_PROGRAMS = ifo_dump vob_dump play_title title_info disc_id ifo_dump_SOURCES = ifo_dump.c ifo_dump_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ +vob_dump_SOURCES = vob_dump.c +vob_dump_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + play_title_SOURCES = play_title.c play_title_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ diff -Naur libdvdread-0.9.4-orig/src/Makefile.am~ libdvdread-0.9.4/src/Makefile.am~ --- libdvdread-0.9.4-orig/src/Makefile.am~ 1969-12-31 16:00:00.000000000 -0800 +++ libdvdread-0.9.4/src/Makefile.am~ 2003-01-12 07:21:20.000000000 -0800 @@ -0,0 +1,20 @@ +# +# There really shouldn't be any need to use @DL_LIBS@ and @CSS_LIBS@ +# here but old versions of libtool failed to do the correct thing + +INCLUDES = -I$(top_srcdir) + +noinst_PROGRAMS = ifo_dump play_title title_info disc_id + +ifo_dump_SOURCES = ifo_dump.c +ifo_dump_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + +play_title_SOURCES = play_title.c +play_title_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + +title_info_SOURCES = title_info.c +title_info_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + +disc_id_SOURCES = disc_id.c +disc_id_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + diff -Naur libdvdread-0.9.4-orig/src/Makefile.in libdvdread-0.9.4/src/Makefile.in --- libdvdread-0.9.4-orig/src/Makefile.in 2003-02-22 14:40:27.000000000 -0800 +++ libdvdread-0.9.4/src/Makefile.in 2003-10-16 16:01:18.000000000 -0700 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.6.2 from Makefile.am. +# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 @@ -94,11 +94,14 @@ INCLUDES = -I$(top_srcdir) -noinst_PROGRAMS = ifo_dump play_title title_info disc_id +noinst_PROGRAMS = ifo_dump vob_dump play_title title_info disc_id ifo_dump_SOURCES = ifo_dump.c ifo_dump_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ +vob_dump_SOURCES = vob_dump.c +vob_dump_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ + play_title_SOURCES = play_title.c play_title_LDADD = $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_LIBS@ @@ -111,8 +114,8 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -noinst_PROGRAMS = ifo_dump$(EXEEXT) play_title$(EXEEXT) \ - title_info$(EXEEXT) disc_id$(EXEEXT) +noinst_PROGRAMS = ifo_dump$(EXEEXT) vob_dump$(EXEEXT) \ + play_title$(EXEEXT) title_info$(EXEEXT) disc_id$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_disc_id_OBJECTS = disc_id.$(OBJEXT) @@ -131,6 +134,10 @@ title_info_OBJECTS = $(am_title_info_OBJECTS) title_info_DEPENDENCIES = $(top_builddir)/dvdread/libdvdread.la title_info_LDFLAGS = +am_vob_dump_OBJECTS = vob_dump.$(OBJEXT) +vob_dump_OBJECTS = $(am_vob_dump_OBJECTS) +vob_dump_DEPENDENCIES = $(top_builddir)/dvdread/libdvdread.la +vob_dump_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) @@ -140,7 +147,8 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/disc_id.Po ./$(DEPDIR)/ifo_dump.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/play_title.Po ./$(DEPDIR)/title_info.Po +@AMDEP_TRUE@ ./$(DEPDIR)/play_title.Po ./$(DEPDIR)/title_info.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vob_dump.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ @@ -150,9 +158,9 @@ $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(disc_id_SOURCES) $(ifo_dump_SOURCES) \ - $(play_title_SOURCES) $(title_info_SOURCES) + $(play_title_SOURCES) $(title_info_SOURCES) $(vob_dump_SOURCES) DIST_COMMON = Makefile.am Makefile.in -SOURCES = $(disc_id_SOURCES) $(ifo_dump_SOURCES) $(play_title_SOURCES) $(title_info_SOURCES) +SOURCES = $(disc_id_SOURCES) $(ifo_dump_SOURCES) $(play_title_SOURCES) $(title_info_SOURCES) $(vob_dump_SOURCES) all: all-am @@ -182,6 +190,9 @@ title_info$(EXEEXT): $(title_info_OBJECTS) $(title_info_DEPENDENCIES) @rm -f title_info$(EXEEXT) $(LINK) $(title_info_LDFLAGS) $(title_info_OBJECTS) $(title_info_LDADD) $(LIBS) +vob_dump$(EXEEXT): $(vob_dump_OBJECTS) $(vob_dump_DEPENDENCIES) + @rm -f vob_dump$(EXEEXT) + $(LINK) $(vob_dump_LDFLAGS) $(vob_dump_OBJECTS) $(vob_dump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core @@ -193,6 +204,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ifo_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/play_title.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/title_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vob_dump.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) diff -Naur libdvdread-0.9.4-orig/src/vob_dump.c libdvdread-0.9.4/src/vob_dump.c --- libdvdread-0.9.4-orig/src/vob_dump.c 1969-12-31 16:00:00.000000000 -0800 +++ libdvdread-0.9.4/src/vob_dump.c 2003-10-16 16:00:31.000000000 -0700 @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2002 Scott Smith (trckjunky@users.sourceforge.net) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +#include "config.h" + +#include +#include +#include + +#include +#include + +static const char RCSID[]="$Id: //depot/dvdauthor/src/vob_dump.c#4 $"; + +void FindVobus(const char *fname) +{ + static unsigned char buf[2048]; + FILE *h; + int cursect=0; + + h=fopen(fname,"r"); + if( !h ) + return; + while(1) { + if( 2048 != fread(buf,1,2048,h) ) + break; + if( buf[14] == 0 && + buf[15] == 0 && + buf[16] == 1 && + buf[17] == 0xbb && // system header + buf[38] == 0 && + buf[39] == 0 && + buf[40] == 1 && + buf[41] == 0xbf && // 1st private2 + buf[1024] == 0 && + buf[1025] == 0 && + buf[1026] == 1 && + buf[1027] == 0xbf ) // 2nd private2 + { + pci_t p; + dsi_t d; + + navRead_PCI(&p,buf+0x2d); + navRead_DSI(&d,buf+0x407); + printf("\n\nVOBU: %x (%02x%02x%02x%02x%02x%02x)\n",cursect,buf[4]&255,buf[5]&255,buf[6]&255,buf[7]&255,buf[8]&255,buf[9]&255); + navPrint_PCI(&p); + navPrint_DSI(&d); + } + cursect++; + } + fclose(h); +} + +int main(int argc, char *argv[]) +{ + if( argc != 2 ) { + fprintf(stderr,"must pass vob as argument\n"); + return 1; + } + FindVobus(argv[1]); + return 0; +}