[libbluray-devel] Minor optimization

hpi1 git at videolan.org
Mon Feb 21 14:30:04 CET 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Feb 20 17:39:46 2011 +0200| [3310396c49cd99885353ea152c03ac4121a9f70b] | committer: hpi1

Minor optimization

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=3310396c49cd99885353ea152c03ac4121a9f70b
---

 src/libbluray/decoders/graphics_controller.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 6007860..a5cb744 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -756,10 +756,10 @@ static int _mouse_move(GRAPHICS_CONTROLLER *gc, unsigned x, unsigned y, GC_NAV_C
             continue;
 
         /* mouse is over button */
+        gc->valid_mouse_position = 1;
 
         /* is button already selected? */
         if (button->id == cur_btn_id) {
-            gc->valid_mouse_position = 1;
             return 0;
         }
 
@@ -771,11 +771,9 @@ static int _mouse_move(GRAPHICS_CONTROLLER *gc, unsigned x, unsigned y, GC_NAV_C
         bd_psr_write(gc->regs, PSR_SELECTED_BUTTON_ID, new_btn_id);
 
         _render_page(gc, -1, cmds);
-
-        gc->valid_mouse_position = 1;
     }
 
-     return gc->valid_mouse_position;
+    return gc->valid_mouse_position;
 }
 
 int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS *cmds)



More information about the libbluray-devel mailing list