[libbluray-devel] commit: _find_button_page(): optionally return bog index (hpi1 )

git at videolan.org git at videolan.org
Mon Nov 15 14:35:07 CET 2010


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Nov 15 15:34:20 2010 +0200| [ea69f92f5ffb281b997182f54045f6aba119ca57] | committer: hpi1 

_find_button_page(): optionally return bog index

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

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

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index 227bee7..26694ee 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -200,20 +200,23 @@ static BD_IG_BUTTON *_find_button_bog(BD_IG_BOG *bog, unsigned button_id)
 
     for (ii = 0; ii < bog->num_buttons; ii++) {
         if (bog->button[ii].id == button_id) {
-          return &bog->button[ii];
+            return &bog->button[ii];
         }
     }
 
     return NULL;
 }
 
-static BD_IG_BUTTON *_find_button_page(BD_IG_PAGE *page, unsigned button_id)
+static BD_IG_BUTTON *_find_button_page(BD_IG_PAGE *page, unsigned button_id, unsigned *bog_idx)
 {
     unsigned ii;
 
     for (ii = 0; ii < page->num_bogs; ii++) {
         BD_IG_BUTTON *button = _find_button_bog(&page->bog[ii], button_id);
         if (button) {
+            if (bog_idx) {
+                *bog_idx = ii;
+            }
             return button;
         }
     }
@@ -414,7 +417,7 @@ static void _user_input(GRAPHICS_CONTROLLER *gc, bd_vk_key_e key, GC_NAV_CMDS *c
             }
 
             if (new_btn_id != cur_btn_id) {
-                BD_IG_BUTTON *button = _find_button_page(page, new_btn_id);
+                BD_IG_BUTTON *button = _find_button_page(page, new_btn_id, NULL);
                 if (button) {
                     cmds->sound_id_ref = button->selected_sound_id_ref;
                 }
@@ -482,7 +485,7 @@ static void _set_button_page(GRAPHICS_CONTROLLER *gc, uint32_t param, GC_NAV_CMD
     }
 
     if (button_flag) {
-        button = _find_button_page(page, button_id);
+        button = _find_button_page(page, button_id, NULL);
         if (!page_flag) {
             if (!button) {
               /* page not given, invalid button --> ignore command */



More information about the libbluray-devel mailing list