[libbluray-devel] Added _select_page()

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


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Tue Feb 15 15:28:29 2011 +0200| [4f7ce056fc2a0490a10949658546888e86df5fc0] | committer: hpi1

Added _select_page()

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

 src/libbluray/decoders/graphics_controller.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/libbluray/decoders/graphics_controller.c b/src/libbluray/decoders/graphics_controller.c
index f352b02..edd3e95 100644
--- a/src/libbluray/decoders/graphics_controller.c
+++ b/src/libbluray/decoders/graphics_controller.c
@@ -214,6 +214,13 @@ static void _gc_clear_osd(GRAPHICS_CONTROLLER *gc, int plane)
     }
 }
 
+static void _select_page(GRAPHICS_CONTROLLER *gc, uint16_t page_id)
+{
+    bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, page_id);
+    _gc_clear_osd(gc, 1);
+    _reset_enabled_button(gc);
+}
+
 static void _gc_reset(GRAPHICS_CONTROLLER *gc)
 {
     _gc_clear_osd(gc, 0);
@@ -292,13 +299,9 @@ void gc_decode_ts(GRAPHICS_CONTROLLER *gc, uint16_t pid, uint8_t *block, unsigne
             return;
         }
 
-        bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, 0);
-
-        gc->ig_drawn = 0;
         gc->popup_visible = 0;
 
-        _gc_clear_osd(gc, 1);
-        _reset_enabled_button(gc);
+        _select_page(gc, 0);
 
         bd_mutex_unlock(&gc->mutex);
     }
@@ -557,11 +560,7 @@ static void _set_button_page(GRAPHICS_CONTROLLER *gc, uint32_t param, GC_NAV_CMD
 
         /* page changes */
 
-        bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, page_id);
-
-        _reset_enabled_button(gc);
-        _gc_clear_osd(gc, 1);
-
+        _select_page(gc, page_id);
 
     } else {
         /* page does not change */
@@ -826,9 +825,7 @@ int gc_run(GRAPHICS_CONTROLLER *gc, gc_ctrl_e ctrl, uint32_t param, GC_NAV_CMDS
             gc->popup_visible = !!param;
 
             if (gc->popup_visible) {
-                bd_psr_write(gc->regs, PSR_MENU_PAGE_ID, 0);
-                _reset_enabled_button(gc);
-                _gc_clear_osd(gc, 1);
+                _select_page(gc, 0);
             }
 
             /* fall thru */



More information about the libbluray-devel mailing list