# HG changeset patch # User jcdutton # Date 1019682925 0 # Node ID 8b08ee66cbff8cae5bb7161345a94b2193b22e04 # Parent 630b6733e492b0563712b37d95d97eaa88bea3e5 Quiet please!!! diff -r 630b6733e492 -r 8b08ee66cbff decoder.c --- a/decoder.c Wed Apr 24 00:47:46 2002 +0000 +++ b/decoder.c Wed Apr 24 21:15:25 2002 +0000 @@ -556,6 +556,7 @@ break; default: /* Unknown command */ fprintf(stderr, "WARNING: Unknown Command=%x\n", vm_getbits(&command, 0, 3)); + assert(0); } /* Check if there are bits not yet examined */ @@ -603,8 +604,8 @@ #ifdef TRACE fprintf(stderr, "libdvdnav: Registers after transaction\n"); vmPrint_registers( registers ); + fprintf(stderr, "eval: Doing Link/Jump/Call\n"); #endif - fprintf(stderr, "eval: Doing Link/Jump/Call\n"); return 1; } diff -r 630b6733e492 -r 8b08ee66cbff decoder.h --- a/decoder.h Wed Apr 24 00:47:46 2002 +0000 +++ b/decoder.h Wed Apr 24 21:15:25 2002 +0000 @@ -32,7 +32,7 @@ #include /* vm_cmd_t */ /* Uncomment for tracing */ -#define TRACE +/* #define TRACE */ typedef enum { LinkNoLink = 0, diff -r 630b6733e492 -r 8b08ee66cbff dvdnav.c --- a/dvdnav.c Wed Apr 24 00:47:46 2002 +0000 +++ b/dvdnav.c Wed Apr 24 21:15:25 2002 +0000 @@ -25,6 +25,10 @@ #include "config.h" #endif +/* +#define LOG_DEBUG +*/ + #include #include #include "dvdnav_internal.h" @@ -211,10 +215,14 @@ printerr("Passed a NULL pointer"); return S_ERR; } +#ifdef LOG_DEBUG fprintf(stderr,"dvdnav:close:called\n"); +#endif if (this->file) { DVDCloseFile(this->file); +#ifdef LOG_DEBUG fprintf(stderr,"dvdnav:close:file closing\n"); +#endif this->file = NULL; } @@ -224,7 +232,9 @@ } if (this->file) { DVDCloseFile(this->file); +#ifdef LOG_DEBUG fprintf(stderr,"dvdnav:close2:file closing\n"); +#endif this->file = NULL; } pthread_mutex_destroy(&this->vm_lock); @@ -237,28 +247,40 @@ dvdnav_status_t dvdnav_reset(dvdnav_t *this) { dvdnav_status_t result; +#ifdef LOG_DEBUG printf("dvdnav:reset:called\n"); +#endif if(!this) { printerr("Passed a NULL pointer"); return S_ERR; } +#ifdef LOG_DEBUG printf("getting lock\n"); +#endif pthread_mutex_lock(&this->vm_lock); +#ifdef LOG_DEBUG printf("reseting vm\n"); +#endif if(vm_reset(this->vm, NULL) == -1) { printerr("Error restarting the VM"); pthread_mutex_unlock(&this->vm_lock); return S_ERR; } +#ifdef LOG_DEBUG printf("clearing dvdnav\n"); +#endif result=dvdnav_clear(this); +#ifdef LOG_DEBUG printf("starting vm\n"); +#endif if(!this->started) { /* Start the VM */ vm_start(this->vm); this->started = 1; } +#ifdef LOG_DEBUG printf("unlocking\n"); +#endif pthread_mutex_unlock(&this->vm_lock); return result; } @@ -495,11 +517,15 @@ if(this->spu_clut_changed) { (*event) = DVDNAV_SPU_CLUT_CHANGE; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:SPU_CLUT_CHANGE\n"); +#endif (*len) = sizeof(dvdnav_still_event_t); memcpy(buf, &(state->pgc->palette), 16 * sizeof(uint32_t)); this->spu_clut_changed = 0; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:SPU_CLUT_CHANGE returning S_OK\n"); +#endif pthread_mutex_unlock(&this->vm_lock); return S_OK; } @@ -507,12 +533,16 @@ if(this->position_current.spu_channel != this->position_next.spu_channel) { dvdnav_stream_change_event_t stream_change; (*event) = DVDNAV_SPU_STREAM_CHANGE; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:SPU_STREAM_CHANGE\n"); +#endif (*len) = sizeof(dvdnav_stream_change_event_t); stream_change.physical = vm_get_subp_active_stream( this->vm ); memcpy(buf, &(stream_change), sizeof( dvdnav_stream_change_event_t)); this->position_current.spu_channel = this->position_next.spu_channel; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:SPU_STREAM_CHANGE stream_id=%d returning S_OK\n",stream_change.physical); +#endif pthread_mutex_unlock(&this->vm_lock); return S_OK; } @@ -520,12 +550,16 @@ if(this->position_current.audio_channel != this->position_next.audio_channel) { dvdnav_stream_change_event_t stream_change; (*event) = DVDNAV_AUDIO_STREAM_CHANGE; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:AUDIO_STREAM_CHANGE\n"); +#endif (*len) = sizeof(dvdnav_stream_change_event_t); stream_change.physical= vm_get_audio_active_stream( this->vm ); memcpy(buf, &(stream_change), sizeof( dvdnav_stream_change_event_t)); this->position_current.audio_channel = this->position_next.audio_channel; +#ifdef LOG_DEBUG fprintf(stderr,"libdvdnav:AUDIO_STREAM_CHANGE stream_id=%d returning S_OK\n",stream_change.physical); +#endif pthread_mutex_unlock(&this->vm_lock); return S_OK; } @@ -640,7 +674,9 @@ if(this->vobu.vobu_next == SRI_END_OF_CELL) { /* End of Cell from NAV DSI info */ +#ifdef LOG_DEBUG fprintf(stderr, "Still set to %x\n", this->position_next.still); +#endif this->position_current.still = this->position_next.still; if( this->position_current.still == 0 || this->skip_still ) { @@ -871,6 +907,9 @@ /* * $Log$ + * Revision 1.16 2002/04/24 21:15:25 jcdutton + * Quiet please!!! + * * Revision 1.15 2002/04/24 00:47:46 jcdutton * Some more cleanups. * Improve button passing. diff -r 630b6733e492 -r 8b08ee66cbff highlight.c --- a/highlight.c Wed Apr 24 00:47:46 2002 +0000 +++ b/highlight.c Wed Apr 24 21:15:25 2002 +0000 @@ -164,7 +164,9 @@ dvdnav_status_t dvdnav_get_highlight_area(pci_t* nav_pci , int32_t button, int32_t mode, dvdnav_highlight_area_t* highlight) { btni_t *button_ptr; +#ifdef BUTTON_TESTING fprintf(stderr,"Button get_highlight_area %i\n", button); +#endif /* Set the highlight SPRM if the passed button was valid*/ if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns)) { @@ -185,13 +187,13 @@ } highlight->pts = nav_pci->hli.hl_gi.hli_s_ptm; highlight->buttonN = button; -//#ifdef BUTTON_TESTING +#ifdef BUTTON_TESTING fprintf(stderr,"highlight.c:Highlight area is (%u,%u)-(%u,%u), display = %i, button = %u\n", button_ptr->x_start, button_ptr->y_start, button_ptr->x_end, button_ptr->y_end, 1, button); -//#endif +#endif return S_OK; } @@ -218,7 +220,9 @@ button_ptr = __get_current_button(this); /* Finally, make the VM execute the appropriate code and * scedule a jump */ +#ifdef BUTTON_TESTING fprintf(stderr, "libdvdnav: Evaluating Button Activation commands.\n"); +#endif if(vm_eval_cmd(this->vm, &(button_ptr->cmd)) == 1) { /* Command caused a jump */ this->vm->hop_channel++; @@ -236,7 +240,9 @@ return S_ERR; } - fprintf(stderr,"Button select %i\n", button); +#ifdef BUTTON_TESTING + fprintf(stderr,"libdvdnav: Button select %i\n", button); +#endif /* Set the highlight SPRM if the passed button was valid*/ if((button <= 0) || (button > this->pci.hli.hl_gi.btn_ns)) { diff -r 630b6733e492 -r 8b08ee66cbff vm.c --- a/vm.c Wed Apr 24 00:47:46 2002 +0000 +++ b/vm.c Wed Apr 24 21:15:25 2002 +0000 @@ -262,7 +262,9 @@ link_values = process_command(vm,link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_start: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); @@ -310,7 +312,9 @@ link_values = process_command(vm, link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_start_title: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 0; /* ?? */ @@ -326,7 +330,9 @@ link_values = process_command(vm, link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_jump_prog: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 0; /* ?? */ @@ -340,7 +346,9 @@ link_values = process_command(vm, link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_eval_cmd: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 1; /* Something changed, Jump */ } else { @@ -355,7 +363,9 @@ link_values = process_command(vm,link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_get_next_cell: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 0; /* ?? */ @@ -368,7 +378,9 @@ link_values = process_command(vm,link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_top_pg: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 1; /* Jump */ @@ -385,7 +397,9 @@ link_values = process_command(vm,link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_go_up: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 1; /* Jump */ @@ -456,7 +470,9 @@ link_values = process_command(vm, link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_menu_call: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); return 1; /* Jump */ } else { @@ -500,12 +516,16 @@ link_values = process_command(vm, link_values); assert(link_values.command == PlayThis); (vm->state).blockN = link_values.data1; +#ifdef TRACE fprintf(stderr, "vm_resume1: blockN set to 0x%x\n", (vm->state).blockN); +#endif assert( (vm->state).blockN == 0 ); } else { (vm->state).cellN = (vm->state).rsm_cellN; (vm->state).blockN = (vm->state).rsm_blockN; +#ifdef TRACE fprintf(stderr, "vm_resume2: blockN set to 0x%x\n", (vm->state).blockN); +#endif /* (vm->state).pgN = ?? does this gets the righ value in play_Cell, no! */ if(set_PGN(vm)) { /* Were at or past the end of the PGC, should not happen for a RSM */ @@ -524,7 +544,9 @@ int vm_get_audio_stream(vm_t *vm, int audioN) { int streamN = -1; - fprintf(stderr,"dvdnav:vm.c:get_audio_stream audioN=%d\n",audioN); +#ifdef TRACE + fprintf(stderr,"dvdnav:vm.c:get_audio_stream audioN=%d\n",audioN); +#endif if((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN) { @@ -817,11 +839,14 @@ { link_t link_values; +#ifdef TRACE fprintf(stderr, "vm: play_PGC:"); - if((vm->state).domain != FP_DOMAIN) + if((vm->state).domain != FP_DOMAIN) { fprintf(stderr, " (vm->state).pgcN (%i)\n", get_PGCN(vm)); - else + } else { fprintf(stderr, " first_play_pgc\n"); + } +#endif /* This must be set before the pre-commands are executed because they */ /* might contain a CallSS that will save resume state */ @@ -840,7 +865,9 @@ /* link_values contains the 'jump' return value */ return link_values; } else { +#ifdef TRACE fprintf(stderr, "PGC pre commands didn't do a Jump, Link or Call\n"); +#endif } } return play_PG(vm); @@ -849,12 +876,16 @@ static link_t play_PG(vm_t *vm) { +#ifdef TRACE fprintf(stderr, "play_PG: (vm->state).pgN (%i)\n", (vm->state).pgN); +#endif assert((vm->state).pgN > 0); if((vm->state).pgN > (vm->state).pgc->nr_of_programs) { +#ifdef TRACE fprintf(stderr, "(vm->state).pgN (%i) == pgc->nr_of_programs + 1 (%i)\n", (vm->state).pgN, (vm->state).pgc->nr_of_programs + 1); +#endif //assert((vm->state).pgN == (vm->state).pgc->nr_of_programs + 1); return play_PGC_post(vm); } @@ -867,12 +898,16 @@ static link_t play_Cell(vm_t *vm) { +#ifdef TRACE fprintf(stderr, "play_Cell: (vm->state).cellN (%i)\n", (vm->state).cellN); +#endif assert((vm->state).cellN > 0); if((vm->state).cellN > (vm->state).pgc->nr_of_cells) { +#ifdef TRACE fprintf(stderr, "(vm->state).cellN (%i) == pgc->nr_of_cells + 1 (%i)\n", (vm->state).cellN, (vm->state).pgc->nr_of_cells + 1); +#endif assert((vm->state).cellN == (vm->state).pgc->nr_of_cells + 1); return play_PGC_post(vm); } @@ -928,7 +963,9 @@ { cell_playback_t *cell; +#ifdef TRACE fprintf(stderr, "play_Cell_post: (vm->state).cellN (%i)\n", (vm->state).cellN); +#endif cell = &(vm->state).pgc->cell_playback[(vm->state).cellN - 1]; @@ -940,7 +977,9 @@ assert((vm->state).pgc->command_tbl != NULL); assert((vm->state).pgc->command_tbl->nr_of_cell >= cell->cell_cmd_nr); +#ifdef TRACE fprintf(stderr, "Cell command pressent, executing\n"); +#endif if(vmEval_CMD(&(vm->state).pgc->command_tbl->cell_cmds[cell->cell_cmd_nr - 1], 1, &(vm->state).registers, &link_values)) { return link_values; @@ -986,7 +1025,9 @@ /* Figure out the correct pgN for the new cell */ if(set_PGN(vm)) { +#ifdef TRACE fprintf(stderr, "last cell in this PGC\n"); +#endif return play_PGC_post(vm); } @@ -998,7 +1039,9 @@ { link_t link_values; +#ifdef TRACE fprintf(stderr, "play_PGC_post:\n"); +#endif assert((vm->state).pgc->still_time == 0); /* FIXME $$$ */ @@ -1031,6 +1074,7 @@ if (vm->badness_counter > 1) fprintf(stderr, "**** process_command re-entered %d*****\n",vm->badness_counter); while(link_values.command != PlayThis) { +#ifdef TRACE vmPrint_LINK(link_values); fprintf(stderr, "Link values %i %i %i %i\n", link_values.command, @@ -1038,6 +1082,7 @@ fprintf(stderr, "Before:"); vm_print_current_domain_state(vm); +#endif switch(link_values.command) { case LinkNoLink: @@ -1285,12 +1330,14 @@ /* ifoOpenNewVTSI:data1 */ /* VTS_TTN_REG:data2 */ /* get_MENU:data3 */ +#ifdef TRACE fprintf(stderr, "dvdnav: BUG TRACKING *******************************************************************\n"); fprintf(stderr, " data1=%u data2=%u data3=%u\n", link_values.data1, link_values.data2, link_values.data3); fprintf(stderr, "dvdnav: *******************************************************************\n"); +#endif if(link_values.data1 !=0) { assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */ @@ -1365,8 +1412,11 @@ assert(0); break; } + +#ifdef TRACE fprintf(stderr, "After:"); vm_print_current_domain_state(vm); +#endif } vm->badness_counter--; @@ -1539,7 +1589,9 @@ } else if((vm->state).domain == VMGM_DOMAIN) { aspect = vm->vmgi->vmgi_mat->vmgm_video_attr.display_aspect_ratio; } +#ifdef TRACE fprintf(stderr, "dvdnav:get_video_aspect:aspect=%d\n",aspect); +#endif assert(aspect == 0 || aspect == 3); (vm->state).registers.SPRM[14] &= ~(0x3 << 10); (vm->state).registers.SPRM[14] |= aspect << 10; @@ -1627,6 +1679,9 @@ /* * $Log$ + * Revision 1.16 2002/04/24 21:15:25 jcdutton + * Quiet please!!! + * * Revision 1.15 2002/04/23 13:18:31 jcdutton * Insert some assert commands to hopefully catch a DVD which will give us information on what to do if these values are != 0. *