changeset 136:5897ff629f7c src

reorganize mutual header inclusion to fix warnings when compiling with TRACE defined fix vm_jump_title_part to use correct title number (up to now the number was considered to be VTS-relative, which it is not)
author mroi
date Thu, 27 Mar 2003 15:12:26 +0000
parents 5204d4e4cd3b
children 15e239caef8f
files decoder.c decoder.h dvdnav_internal.h.in highlight.c navigation.c searching.c settings.c vm.c vm.h vmcmd.c vmcmd.h
diffstat 11 files changed, 27 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/decoder.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/decoder.c	Thu Mar 27 15:12:26 2003 +0000
@@ -32,8 +32,6 @@
 #include <string.h>  /* For memset */
 #include <dvdread/ifo_types.h> /* vm_cmd_t */
 #include <assert.h>
-#include "vmcmd.h"
-#include "decoder.h"
 #include "dvdnav_internal.h"
 
 uint32_t vm_getbits(command_t *command, int start, int count) {
--- a/decoder.h	Wed Mar 26 14:37:23 2003 +0000
+++ b/decoder.h	Thu Mar 27 15:12:26 2003 +0000
@@ -29,6 +29,7 @@
 #include <sys/time.h>
 
 #include <dvdread/ifo_types.h> /*  vm_cmd_t */
+#include "dvdnav_internal.h"
 
 /* link command types */
 typedef enum {
--- a/dvdnav_internal.h.in	Wed Mar 26 14:37:23 2003 +0000
+++ b/dvdnav_internal.h.in	Thu Mar 27 15:12:26 2003 +0000
@@ -28,9 +28,6 @@
 #include "config.h"
 #endif
 
-#include "dvdnav.h"
-#include "vm.h"
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -44,10 +41,14 @@
 #include <dvdread/ifo_read.h>
 #include <dvdread/ifo_types.h>
 
-
 /* Uncomment for VM command tracing */
 /* #define TRACE */
 
+#include "decoder.h"
+#include "dvdnav.h"
+#include "vm.h"
+#include "vmcmd.h"
+
 /* where should libdvdnav write its messages (stdout/stderr) */
 #define MSG_OUT stdout
 
--- a/highlight.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/highlight.c	Thu Mar 27 15:12:26 2003 +0000
@@ -26,12 +26,9 @@
 #endif
 
 #include <assert.h>
-
+#include <dvdread/nav_types.h>
 #include "dvdnav_internal.h"
 
-#include "vm.h"
-#include <dvdread/nav_types.h>
-
 /*
 #define BUTTON_TESTING
 */
@@ -39,7 +36,6 @@
 #ifdef BUTTON_TESTING
 
 #include <dvdread/nav_print.h>
-#include "vmcmd.h"
 
 static void print_time(dvd_time_t *dtime) {
   const char *rate;
--- a/navigation.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/navigation.c	Thu Mar 27 15:12:26 2003 +0000
@@ -27,8 +27,6 @@
 
 #include "dvdnav_internal.h"
 
-#include "vm.h"
-
 /* Navigation API calls */
 
 dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) {
--- a/searching.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/searching.c	Thu Mar 27 15:12:26 2003 +0000
@@ -26,11 +26,8 @@
 #endif
 
 #include <assert.h>
-
 #include "dvdnav_internal.h"
 
-#include "vm.h"
-
 /*
 #define LOG_DEBUG
 */
--- a/settings.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/settings.c	Thu Mar 27 15:12:26 2003 +0000
@@ -27,8 +27,6 @@
 
 #include "dvdnav_internal.h"
 
-#include "vm.h"
-
 /* Characteristics/setting API calls */
 
 dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int *region) {
--- a/vm.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/vm.c	Thu Mar 27 15:12:26 2003 +0000
@@ -40,9 +40,6 @@
 #include <dvdread/ifo_types.h>
 #include <dvdread/ifo_read.h>
 
-#include "decoder.h"
-#include "vmcmd.h"
-#include "vm.h"
 #include "dvdnav_internal.h"
 
 /*
@@ -69,6 +66,7 @@
 
 /* Set */
 static int  set_TT(vm_t *vm, int tt);
+static int  set_PTT(vm_t *vm, int tt, int ptt);
 static int  set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn);
 static int  set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part);
 static int  set_FP_PGC(vm_t *vm);
@@ -481,13 +479,13 @@
 }
 
 int vm_jump_title_part(vm_t *vm, int title, int part) {
-  int vtsN;
-
-  vtsN = vm->vmgi->tt_srpt->title[title - 1].title_set_nr;
-
-  if(!set_VTS_PTT(vm, vtsN, title, part))
+  if(!set_PTT(vm, title, part))
     return 0;
-  process_command(vm, play_PGC_PG(vm, (vm->state).pgN));
+  /* Some DVDs do not want us to jump directly into a title and have
+   * PGC pre commands taking us back to some menu. Since we do not like that,
+   * we do not execute PGC pre commands but directly play the PG. */
+  /* process_command(vm, play_PGC_PG(vm, (vm->state).pgN)); */
+  process_command(vm, play_PG(vm));
   return 1;
 }
 
@@ -1517,10 +1515,13 @@
 /* Set functions */
 
 static int set_TT(vm_t *vm, int tt) {  
+  return set_PTT(vm, tt, 1);
+}
+
+static int set_PTT(vm_t *vm, int tt, int ptt) {
   assert(tt <= vm->vmgi->tt_srpt->nr_of_srpts);
-  (vm->state).TTN_REG = tt;
-  return set_VTS_TT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr,
-		    vm->vmgi->tt_srpt->title[tt - 1].vts_ttn);
+  return set_VTS_PTT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr,
+		     vm->vmgi->tt_srpt->title[tt - 1].vts_ttn, ptt);
 }
 
 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn) {
@@ -1807,6 +1808,11 @@
 
 /*
  * $Log$
+ * Revision 1.49  2003/03/27 15:12:22  mroi
+ * reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
+ * fix vm_jump_title_part to use correct title number (up to now the number was
+ * considered to be VTS-relative, which it is not)
+ *
  * Revision 1.48  2003/03/26 14:37:23  mroi
  * I should get a brain and learn how to handle BCD...
  * also fixing a possible mis-jump with angled cells
--- a/vm.h	Wed Mar 26 14:37:23 2003 +0000
+++ b/vm.h	Thu Mar 27 15:12:26 2003 +0000
@@ -26,9 +26,8 @@
 #ifndef VM_H_INCLUDED
 #define VM_H_INCLUDED
 
-#include "decoder.h"
 #include "remap.h"
-#include <dvd_types.h>
+#include "dvdnav_internal.h"
 
 /* DOMAIN enum */
 
--- a/vmcmd.c	Wed Mar 26 14:37:23 2003 +0000
+++ b/vmcmd.c	Thu Mar 27 15:12:26 2003 +0000
@@ -31,7 +31,6 @@
 #include <inttypes.h>
 #include <assert.h>
 
-#include "vmcmd.h"
 #include "dvdnav_internal.h"
 
 
--- a/vmcmd.h	Wed Mar 26 14:37:23 2003 +0000
+++ b/vmcmd.h	Thu Mar 27 15:12:26 2003 +0000
@@ -27,7 +27,7 @@
 
 #include <inttypes.h>
 #include <dvdread/ifo_types.h> /*  Only for vm_cmd_t  */
-#include "decoder.h"
+#include "dvdnav_internal.h"
 
 #ifdef TRACE
 void vmPrint_mnemonic(vm_cmd_t *command);