Mercurial > libdvdnav.hg
changeset 26:794d2e16a4d4 src
Removed un-needed variables.
General Clean up.
author | jcdutton |
---|---|
date | Tue, 23 Apr 2002 12:55:40 +0000 |
parents | df024077cbc1 |
children | fcfbaf8dbfb4 |
files | dvdnav.c dvdnav_internal.h highlight.c navigation.c searching.c |
diffstat | 5 files changed, 11 insertions(+), 115 deletions(-) [+] |
line wrap: on
line diff
--- a/dvdnav.c Tue Apr 23 12:34:39 2002 +0000 +++ b/dvdnav.c Tue Apr 23 12:55:40 2002 +0000 @@ -142,26 +142,15 @@ this->file = NULL; this->open_vtsN = -1; this->open_domain = -1; - this->cell = NULL; - this->jmp_blockN=0; - this->jmp_vobu_start=0; - this->seekto_block=0; memset(&this->pci,0,sizeof(this->pci)); memset(&this->dsi,0,sizeof(this->dsi)); /* Set initial values of flags */ - this->expecting_nav_packet = 1; - this->at_soc = 1; this->position_current.still = 0; this->skip_still = 0; - this->jumping = 0; - this->seeking = 0; this->stop = 0; - this->highlight_changed = 0; this->spu_clut_changed = 0; - this->spu_stream_changed = 0; - this->audio_stream_changed = 0; this->started=0; // this->use_read_ahead @@ -376,8 +365,6 @@ /* We should now have a DSI packet. */ if(p[6] == 0x01) { - //int num=0, current=0; - nPacketLen = p[4] << 8 | p[5]; p += 6; /* dprint("NAV DSI packet\n"); */ @@ -402,8 +389,6 @@ * PCI is used for only non-seemless angle stuff */ int dvdnav_get_vobu(dsi_t* nav_dsi, pci_t* nav_pci, int angle, dvdnav_vobu_t* vobu) { - // int num=0, current=0; - vobu->vobu_start = nav_dsi->dsi_gi.nv_pck_lbn; /* Absolute offset from start of disk */ vobu->vobu_length = nav_dsi->dsi_gi.vobu_ea; /* Relative offset from vobu_start */ @@ -426,8 +411,6 @@ uint32_t next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]; if(next != 0) { - //int dir = 0; - if(next & 0x80000000) { vobu->vobu_next = - (next & 0x3fffffff); } else { @@ -580,7 +563,6 @@ hevent.display = 0; status = S_OK; } - this->highlight_changed = 0; this->position_current.button = this->position_next.button; if (status) { @@ -678,7 +660,6 @@ this->vobu.vobu_length = 0; this->vobu.blockN = this->vobu.vobu_length + 1; /* Make blockN > vobu_lenght to do expected_nav */ - this->expecting_nav_packet = 1; (*event) = DVDNAV_CELL_CHANGE; (*len) = 0; pthread_mutex_unlock(&this->vm_lock); @@ -688,9 +669,6 @@ if (this->vobu.blockN > this->vobu.vobu_length) { /* End of VOBU */ - //dvdnav_nav_packet_event_t nav_event; - - this->expecting_nav_packet = 1; if(this->vobu.vobu_next == SRI_END_OF_CELL) { /* End of Cell from NAV DSI info */ @@ -713,7 +691,6 @@ this->vobu.vobu_length = 0; this->vobu.blockN = this->vobu.vobu_length + 1; /* Make blockN > vobu_next to do expected_nav */ - this->expecting_nav_packet = 1; (*event) = DVDNAV_CELL_CHANGE; (*len) = 0; pthread_mutex_unlock(&this->vm_lock); @@ -753,7 +730,6 @@ } dvdnav_get_vobu(&this->dsi,&this->pci, 0, &this->vobu); this->vobu.blockN=1; - this->expecting_nav_packet = 0; dvdnav_pre_cache_blocks(this, this->vobu.vobu_start+1, this->vobu.vobu_length); @@ -925,6 +901,10 @@ /* * $Log$ + * Revision 1.13 2002/04/23 12:55:40 jcdutton + * Removed un-needed variables. + * General Clean up. + * * Revision 1.12 2002/04/23 12:34:39 f1rmb * Why rewrite vm function, use it instead (this remark is for me, of course ;-) ). * Comment unused var, shut compiler warnings.
--- a/dvdnav_internal.h Tue Apr 23 12:34:39 2002 +0000 +++ b/dvdnav_internal.h Tue Apr 23 12:55:40 2002 +0000 @@ -124,28 +124,15 @@ vm_position_t position_next; vm_position_t position_current; dvdnav_vobu_t vobu; - cell_playback_t *cell; - uint32_t jmp_blockN; - uint32_t jmp_vobu_start; - uint32_t seekto_block; /* NAV data */ pci_t pci; dsi_t dsi; /* Flags */ - int expecting_nav_packet; - int at_soc; /* Are we at the start of a cell? */ - int still_frame; /* >=0 send still frame event with len still_frame - * -1 don't send event. */ int skip_still; /* Set when skipping a still */ - int jumping; /* non-zero if we are in the process of jumping */ - int seeking; /* non-zero if we are in the process of seeking */ int stop; /* Are we stopped? (note not paused, actually stopped) */ - int highlight_changed; /* The highlight changed */ int spu_clut_changed; /* The SPU CLUT changed */ - int spu_stream_changed; /* The SPU STREAM changed */ - int audio_stream_changed; /* The AUDIO STREAM changed */ int started; /* vm_start has been called? */ int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ /* VM */ @@ -155,10 +142,6 @@ /* Highlight */ int hli_state; /* State of highlight 0 - disabled, 1 - selected, 2 - activated */ - uint16_t hli_bbox[4]; /* Highlight bounding box */ - uint32_t hli_clut; /* Highlight palette */ - uint32_t hli_pts; /* Highlight PTS for matching with SPU packet. */ - uint32_t hli_buttonN; /* Button number for SPU decoder. */ /* Read-ahead cache. */ uint8_t *cache_buffer; int32_t cache_start_sector; /* -1 means cache invalid */ @@ -170,9 +153,6 @@ char err_str[MAX_ERR_LEN]; }; -/* Common things we do everytime we do a jump */ -void dvdnav_do_post_jump(dvdnav_t *self); - /** USEFUL MACROS **/ #define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args);
--- a/highlight.c Tue Apr 23 12:34:39 2002 +0000 +++ b/highlight.c Tue Apr 23 12:55:40 2002 +0000 @@ -170,7 +170,7 @@ dvdnav_status_t dvdnav_button_activate(dvdnav_t *this) { int button; - btni_t *button_ptr; + btni_t *button_ptr = NULL; if(!this) return S_ERR; @@ -186,36 +186,21 @@ pthread_mutex_unlock(&this->vm_lock); return S_ERR; } - - /* Now get the current button's info */ - if((button_ptr = __get_current_button(this)) == NULL) { - printerr("Error fetching information on current button."); - pthread_mutex_unlock(&this->vm_lock); - return S_ERR; - } - - /* And set the palette */ - if(button_ptr->btn_coln != 0) { - this->hli_clut = - this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][1]; - } else { - this->hli_clut = 0; - } - + /* FIXME: The button command should really be passed in the API instead. */ + button_ptr = __get_current_button(this); /* Finally, make the VM execute the appropriate code and * scedule a jump */ fprintf(stderr, "libdvdnav: Evaluating Button Activation commands.\n"); if(vm_eval_cmd(this->vm, &(button_ptr->cmd)) == 1) { - /* Cammand caused a jump */ - dvdnav_do_post_jump(this); + /* Command caused a jump */ + this->vm->hop_channel++; + this->position_current.still = 0; } - this->vm->hop_channel++; pthread_mutex_unlock(&this->vm_lock); return S_OK; } dvdnav_status_t dvdnav_button_select(dvdnav_t *this, int button) { - btni_t *button_ptr; if(!this) { printerrf("Unable to select button number %i as this state bad", @@ -233,34 +218,9 @@ } this->vm->state.HL_BTNN_REG = (button << 10); - /* Now get the current button's info */ - if((button_ptr = __get_current_button(this)) == NULL) { - printerr("Error fetching information on current button."); - return S_ERR; - } - - this->hli_bbox[0] = button_ptr->x_start; - this->hli_bbox[1] = button_ptr->y_start; - this->hli_bbox[2] = button_ptr->x_end; - this->hli_bbox[3] = button_ptr->y_end; this->hli_state = 1; /* Selected */ - if(button_ptr->btn_coln != 0) { - this->hli_clut = - this->pci.hli.btn_colit.btn_coli[button_ptr->btn_coln-1][0]; - } else { - this->hli_clut = 0; - } - this->hli_pts = this->pci.hli.hl_gi.hli_s_ptm; - this->hli_buttonN = button; // this->position_current.button = -1; /* Force Highligh change */ -#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 return S_OK; }
--- a/navigation.c Tue Apr 23 12:34:39 2002 +0000 +++ b/navigation.c Tue Apr 23 12:55:40 2002 +0000 @@ -32,17 +32,6 @@ /* Navigation API calls */ -/* Common things we do everytime we do a jump */ -void dvdnav_do_post_jump(dvdnav_t *this) { - dvd_state_t *state = &(this->vm->state); - cell_playback_t *cell = &(state->pgc->cell_playback[state->cellN - 1]); - - this->jmp_blockN = 0; /* FIXME: Should this be different? */ - this->jmp_vobu_start = cell->first_sector; - this->jumping = 1; - this->position_current.still = 0; -} - dvdnav_status_t dvdnav_still_skip(dvdnav_t *this) { if(!this) return S_ERR; @@ -98,10 +87,6 @@ vm_start_title(this->vm, title); - /* this->expecting_nav_packet = 1; */ - - dvdnav_do_post_jump(this); - return S_OK; } @@ -133,10 +118,6 @@ vm_jump_prog(this->vm, part); - /* this->expecting_nav_packet = 1; */ - - dvdnav_do_post_jump(this); - return S_OK; } @@ -176,8 +157,6 @@ /* A nice easy function... delegate to the VM */ vm_go_up(this->vm); - dvdnav_do_post_jump(this); - return S_OK; }
--- a/searching.c Tue Apr 23 12:34:39 2002 +0000 +++ b/searching.c Tue Apr 23 12:55:40 2002 +0000 @@ -186,7 +186,7 @@ } if(fnd_cell_nr <= last_cell_nr) { - int32_t vobu, start; //, blockN; + int32_t vobu, start; dvdnav_status_t status; fprintf(stderr,"Seeking to cell %i from choice of %i to %i\n", fnd_cell_nr, first_cell_nr, last_cell_nr); @@ -235,7 +235,6 @@ } fprintf(stderr,"dvdnav: previous chapter\n"); vm_jump_prog(this->vm, state->pgN - 1); - dvdnav_do_post_jump(this); this->vm->hop_channel++; fprintf(stderr,"dvdnav: previous chapter done\n"); @@ -259,7 +258,6 @@ } fprintf(stderr,"dvdnav: next chapter\n"); vm_jump_prog(this->vm, state->pgN + 1); - dvdnav_do_post_jump(this); this->vm->hop_channel++; fprintf(stderr,"dvdnav: next chapter done\n"); @@ -272,7 +270,6 @@ pthread_mutex_lock(&this->vm_lock); state = &(this->vm->state); vm_menu_call(this->vm, menu, 0); - dvdnav_do_post_jump(this); pthread_mutex_unlock(&this->vm_lock); return S_OK; }