Mercurial > libdvdnav.hg
diff highlight.c @ 197:a20a5976a207 src
last_cmd_nav_lbn has to be initialized with an invalid value, so that the first
test to filter double commands will always fail, but 0 is not invalid here!
* use SRI_END_OF_CELL and reenable double command filter
* fix return values of get_current_button()
* use return value of button_auto_action()
author | mroi |
---|---|
date | Mon, 12 May 2003 19:43:11 +0000 |
parents | b751f0790ac6 |
children | ba43bdbb07e8 |
line wrap: on
line diff
--- a/highlight.c Sun May 11 13:18:04 2003 +0000 +++ b/highlight.c Mon May 12 19:43:11 2003 +0000 @@ -223,18 +223,16 @@ if(!this || !pci) { printerr("Passed a NULL pointer."); - return DVDNAV_STATUS_ERR; + return NULL; } if(!pci->hli.hl_gi.hli_ss) { printerr("Not in a menu."); - return DVDNAV_STATUS_ERR; + return NULL; } -#if 0 /* This causes some DVDs to fail to activate buttons. */ if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { printerr("This NAV has already been left."); - return DVDNAV_STATUS_ERR; + return NULL; } -#endif button = this->vm->state.HL_BTNN_REG >> 10; #ifdef BUTTON_TESTING @@ -247,6 +245,7 @@ static dvdnav_status_t button_auto_action(dvdnav_t *this, pci_t *pci) { if (get_current_button(this, pci)->auto_action_mode) return dvdnav_button_activate(this, pci); + return DVDNAV_STATUS_OK; } dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *this, pci_t *pci) { @@ -256,9 +255,7 @@ return DVDNAV_STATUS_ERR; dvdnav_button_select(this, pci, button_ptr->up); - button_auto_action(this, pci); - - return DVDNAV_STATUS_OK; + return button_auto_action(this, pci); } dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *this, pci_t *pci) { @@ -268,9 +265,7 @@ return DVDNAV_STATUS_ERR; dvdnav_button_select(this, pci, button_ptr->down); - button_auto_action(this, pci); - - return DVDNAV_STATUS_OK; + return button_auto_action(this, pci); } dvdnav_status_t dvdnav_right_button_select(dvdnav_t *this, pci_t *pci) { @@ -280,9 +275,7 @@ return DVDNAV_STATUS_ERR; dvdnav_button_select(this, pci, button_ptr->right); - button_auto_action(this, pci); - - return DVDNAV_STATUS_OK; + return button_auto_action(this, pci); } dvdnav_status_t dvdnav_left_button_select(dvdnav_t *this, pci_t *pci) { @@ -292,9 +285,7 @@ return DVDNAV_STATUS_ERR; dvdnav_button_select(this, pci, button_ptr->left); - button_auto_action(this, pci); - - return DVDNAV_STATUS_OK; + return button_auto_action(this, pci); } dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode, @@ -347,12 +338,10 @@ printerr("Not in a menu."); return DVDNAV_STATUS_ERR; } -#if 0 /* This causes some DVDs to fail to activate buttons. */ if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { printerr("This NAV has already been left."); return DVDNAV_STATUS_ERR; } -#endif pthread_mutex_lock(&this->vm_lock); button = this->vm->state.HL_BTNN_REG >> 10; @@ -436,12 +425,10 @@ printerr("Not in a menu."); return DVDNAV_STATUS_ERR; } -#if 0 /* This causes some DVDs to fail to activate buttons. */ if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { printerr("This NAV has already been left."); return DVDNAV_STATUS_ERR; } -#endif #ifdef BUTTON_TESTING fprintf(MSG_OUT, "libdvdnav: Button select %i\n", button); @@ -479,12 +466,10 @@ printerr("Not in a menu."); return DVDNAV_STATUS_ERR; } -#if 0 /* This causes some DVDs to fail to activate buttons. */ if(this->last_cmd_nav_lbn == pci->pci_gi.nv_pck_lbn) { printerr("This NAV has already been left."); return DVDNAV_STATUS_ERR; } -#endif cur_button = this->vm->state.HL_BTNN_REG >> 10;