[libdvdnav-devel] [Git][videolan/libdvdnav][master] Add button forced selection when FOSL_BTNN is present

Jean-Baptiste Kempf gitlab at videolan.org
Wed Jan 17 22:23:20 CET 2018


Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdnav


Commits:
9d094e02 by Pierre Lamot at 2018-01-17T22:22:17+01:00
Add button forced selection when FOSL_BTNN is present

This allows to force the the selection of the current button when activating
a SPU stream.

The behavior is inaccurate though, FOSL_BTNN is supposed to update the register
at time HLI_S_PTM. But it will be good enough for now.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

- - - - -


3 changed files:

- src/dvdnav.c
- src/vm/getset.c
- src/vm/getset.h


Changes:

=====================================
src/dvdnav.c
=====================================
--- a/src/dvdnav.c
+++ b/src/dvdnav.c
@@ -39,6 +39,7 @@
 #include <dvdread/ifo_types.h> /* For vm_cmd_t */
 #include "vm/decoder.h"
 #include "vm/vm.h"
+#include "vm/getset.h"
 #include "dvdnav_internal.h"
 #include "read_cache.h"
 #include <dvdread/nav_read.h>
@@ -790,6 +791,14 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf,
     fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change->physical_pan_scan);
     fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n");
 #endif
+    /* This is not realy the right place to do this. FOSL_BTNN should set the register
+     * at HLI_S_PTM rather than when we enter the SPU. As well we should activate FOAC_BTNN
+     * at HLI_E_PTM
+     */
+    if (this->pci.hli.hl_gi.fosl_btnn != 0) {
+      set_HL_BTN(this->vm, this->pci.hli.hl_gi.fosl_btnn);
+    }
+
     pthread_mutex_unlock(&this->vm_lock);
     return DVDNAV_STATUS_OK;
   }


=====================================
src/vm/getset.c
=====================================
--- a/src/vm/getset.c
+++ b/src/vm/getset.c
@@ -216,6 +216,13 @@ void set_RSMinfo(vm_t *vm, int cellN, int blockN) {
   }
 }
 
+
+/* Force the highlight button number register */
+void set_HL_BTN(vm_t *vm, int btnn)
+{
+    (vm->state).HL_BTNN_REG = btnn << 10;
+}
+
 /* Get functions */
 
 /* Searches the TT tables, to find the current TT.


=====================================
src/vm/getset.h
=====================================
--- a/src/vm/getset.h
+++ b/src/vm/getset.h
@@ -38,6 +38,7 @@ int  set_MENU(vm_t *vm, int menu);
 int  set_PGCN(vm_t *vm, int pgcN);
 int  set_PGN(vm_t *vm); /* Set PGN based on (vm->state).CellN */
 void set_RSMinfo(vm_t *vm, int cellN, int blockN);
+void set_HL_BTN(vm_t *vm, int btnn);
 
 /* Get */
 int get_TT(vm_t *vm, int vtsN, int vts_ttn);



View it on GitLab: https://code.videolan.org/videolan/libdvdnav/commit/9d094e029f5bb3fb47688e8d99ad66137c83bf92

---
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/commit/9d094e029f5bb3fb47688e8d99ad66137c83bf92
You're receiving this email because of your account on code.videolan.org.


More information about the libdvdnav-devel mailing list