changeset 117:816d82ff7eed src

return the correct current hightlight
author mroi
date Wed, 26 Feb 2003 20:31:56 +0000
parents 4d711d0518e9
children 48ba92648842
files highlight.c
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/highlight.c	Tue Feb 25 14:08:16 2003 +0000
+++ b/highlight.c	Wed Feb 26 20:31:56 2003 +0000
@@ -215,7 +215,7 @@
   }
 
   /* Simply return the appropriate value based on the SPRM */
-  (*button) = (this->vm->state.HL_BTNN_REG) >> 10;
+  (*button) = this->position_current.button;
   
   return S_OK;
 }
@@ -223,10 +223,12 @@
 static btni_t *get_current_button(dvdnav_t *this, pci_t *pci) {
   int button = 0;
 
-  if(dvdnav_get_current_highlight(this, &button) != S_OK) {
-    printerr("Unable to get information on current highlight.");
-    return NULL;
+  if(!this) {
+    printerr("Passed a NULL pointer.");
+    return S_ERR;
   }
+
+  button = this->vm->state.HL_BTNN_REG >> 10;
 #ifdef BUTTON_TESTING
   nav_print_PCI(&(this->pci));
 #endif
@@ -353,10 +355,7 @@
 
   pthread_mutex_lock(&this->vm_lock); 
 
-  if(dvdnav_get_current_highlight(this, &button) != S_OK) {
-    pthread_mutex_unlock(&this->vm_lock);
-    return S_ERR;
-  }
+  button = this->vm->state.HL_BTNN_REG >> 10;
 
   if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) {
     /* Special code to handle still menus with no buttons.
@@ -465,8 +464,7 @@
     return S_ERR;
   }
 
-  if(dvdnav_get_current_highlight(this, &cur_button) != S_OK)
-    return S_ERR;
+  cur_button = this->vm->state.HL_BTNN_REG >> 10;
 
   best = 0;
   dist = 0x08000000; /* >> than  (720*720)+(567*567); */