comparison vm.c @ 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 5ce26c18c455
comparison
equal deleted inserted replaced
135:5204d4e4cd3b 136:5897ff629f7c
38 #include <fcntl.h> 38 #include <fcntl.h>
39 39
40 #include <dvdread/ifo_types.h> 40 #include <dvdread/ifo_types.h>
41 #include <dvdread/ifo_read.h> 41 #include <dvdread/ifo_read.h>
42 42
43 #include "decoder.h"
44 #include "vmcmd.h"
45 #include "vm.h"
46 #include "dvdnav_internal.h" 43 #include "dvdnav_internal.h"
47 44
48 /* 45 /*
49 #define STRICT 46 #define STRICT
50 */ 47 */
67 /* Process link - returns 1 if a hop has been performed */ 64 /* Process link - returns 1 if a hop has been performed */
68 static int process_command(vm_t *vm,link_t link_values); 65 static int process_command(vm_t *vm,link_t link_values);
69 66
70 /* Set */ 67 /* Set */
71 static int set_TT(vm_t *vm, int tt); 68 static int set_TT(vm_t *vm, int tt);
69 static int set_PTT(vm_t *vm, int tt, int ptt);
72 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn); 70 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn);
73 static int set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part); 71 static int set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part);
74 static int set_FP_PGC(vm_t *vm); 72 static int set_FP_PGC(vm_t *vm);
75 static int set_MENU(vm_t *vm, int menu); 73 static int set_MENU(vm_t *vm, int menu);
76 static int set_PGCN(vm_t *vm, int pgcN); 74 static int set_PGCN(vm_t *vm, int pgcN);
479 (vm->state).blockN = block; 477 (vm->state).blockN = block;
480 return 1; 478 return 1;
481 } 479 }
482 480
483 int vm_jump_title_part(vm_t *vm, int title, int part) { 481 int vm_jump_title_part(vm_t *vm, int title, int part) {
484 int vtsN; 482 if(!set_PTT(vm, title, part))
485
486 vtsN = vm->vmgi->tt_srpt->title[title - 1].title_set_nr;
487
488 if(!set_VTS_PTT(vm, vtsN, title, part))
489 return 0; 483 return 0;
490 process_command(vm, play_PGC_PG(vm, (vm->state).pgN)); 484 /* Some DVDs do not want us to jump directly into a title and have
485 * PGC pre commands taking us back to some menu. Since we do not like that,
486 * we do not execute PGC pre commands but directly play the PG. */
487 /* process_command(vm, play_PGC_PG(vm, (vm->state).pgN)); */
488 process_command(vm, play_PG(vm));
491 return 1; 489 return 1;
492 } 490 }
493 491
494 int vm_jump_top_pg(vm_t *vm) { 492 int vm_jump_top_pg(vm_t *vm) {
495 process_command(vm, play_PG(vm)); 493 process_command(vm, play_PG(vm));
1515 1513
1516 1514
1517 /* Set functions */ 1515 /* Set functions */
1518 1516
1519 static int set_TT(vm_t *vm, int tt) { 1517 static int set_TT(vm_t *vm, int tt) {
1518 return set_PTT(vm, tt, 1);
1519 }
1520
1521 static int set_PTT(vm_t *vm, int tt, int ptt) {
1520 assert(tt <= vm->vmgi->tt_srpt->nr_of_srpts); 1522 assert(tt <= vm->vmgi->tt_srpt->nr_of_srpts);
1521 (vm->state).TTN_REG = tt; 1523 return set_VTS_PTT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr,
1522 return set_VTS_TT(vm, vm->vmgi->tt_srpt->title[tt - 1].title_set_nr, 1524 vm->vmgi->tt_srpt->title[tt - 1].vts_ttn, ptt);
1523 vm->vmgi->tt_srpt->title[tt - 1].vts_ttn);
1524 } 1525 }
1525 1526
1526 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn) { 1527 static int set_VTS_TT(vm_t *vm, int vtsN, int vts_ttn) {
1527 return set_VTS_PTT(vm, vtsN, vts_ttn, 1); 1528 return set_VTS_PTT(vm, vtsN, vts_ttn, 1);
1528 } 1529 }
1805 #endif 1806 #endif
1806 1807
1807 1808
1808 /* 1809 /*
1809 * $Log$ 1810 * $Log$
1811 * Revision 1.49 2003/03/27 15:12:22 mroi
1812 * reorganize mutual header inclusion to fix warnings when compiling with TRACE defined
1813 * fix vm_jump_title_part to use correct title number (up to now the number was
1814 * considered to be VTS-relative, which it is not)
1815 *
1810 * Revision 1.48 2003/03/26 14:37:23 mroi 1816 * Revision 1.48 2003/03/26 14:37:23 mroi
1811 * I should get a brain and learn how to handle BCD... 1817 * I should get a brain and learn how to handle BCD...
1812 * also fixing a possible mis-jump with angled cells 1818 * also fixing a possible mis-jump with angled cells
1813 * 1819 *
1814 * Revision 1.47 2003/03/24 16:42:59 mroi 1820 * Revision 1.47 2003/03/24 16:42:59 mroi