diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-11-09 21:49:36 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-11-09 21:49:36 +0000 |
commit | 4b444b68f9f75bde65708f70a1dd2f88e7448eca (patch) | |
tree | a0177889bd761407231cdf6e4613ed97e02e86f1 /src/libspudec | |
parent | 8f673370144751ff9e362a2e702950b578e60066 (diff) | |
download | xine-lib-4b444b68f9f75bde65708f70a1dd2f88e7448eca.tar.gz xine-lib-4b444b68f9f75bde65708f70a1dd2f88e7448eca.tar.bz2 |
if we are trying to activate a menu with an invalid button,
fall back to button 1
CVS patchset: 5716
CVS date: 2003/11/09 21:49:36
Diffstat (limited to 'src/libspudec')
-rw-r--r-- | src/libspudec/spu.c | 51 | ||||
-rw-r--r-- | src/libspudec/spu.h | 4 |
2 files changed, 26 insertions, 29 deletions
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index 21af9455b..d86787e63 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -35,7 +35,7 @@ * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: spu.c,v 1.69 2003/10/12 18:51:59 mroi Exp $ + * $Id: spu.c,v 1.70 2003/11/09 21:49:36 mroi Exp $ * */ @@ -70,11 +70,6 @@ #define LOG_NAV 1 */ -void spudec_reassembly (spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len); -void spudec_process( spudec_decoder_t *this, int stream_id); -void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf); -void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, - vo_overlay_t * overlay, vo_overlay_t * base ); static void spudec_do_commands (spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); static void spudec_draw_picture (spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl); static void spudec_discover_clut (spudec_state_t *state, vo_overlay_t *ovl); @@ -370,22 +365,32 @@ void spudec_process (spudec_decoder_t *this, int stream_id) { continue; } if ( this->pci.hli.hl_gi.fosl_btnn > 0) { - int buttonN; xine_event_t event; - this->buttonN = this->pci.hli.hl_gi.fosl_btnn ; - event.type = XINE_EVENT_INPUT_BUTTON_FORCE; - event.stream = this->stream; - event.data = &buttonN; - event.data_length = sizeof(buttonN); - buttonN = this->buttonN; + this->buttonN = this->pci.hli.hl_gi.fosl_btnn ; + event.type = XINE_EVENT_INPUT_BUTTON_FORCE; + event.stream = this->stream; + event.data = &this->buttonN; + event.data_length = sizeof(this->buttonN); xine_event_send(this->stream, &event); } #ifdef LOG_BUTTON fprintf(stderr, "libspudec:Full Overlay\n"); #endif - spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, 0, &this->overlay, - &this->overlay); + if (!spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, 0, + &this->overlay, &this->overlay)) { + /* current button does not exist -> use another one */ + xine_event_t event; + + this->buttonN = 1; + event.type = XINE_EVENT_INPUT_BUTTON_FORCE; + event.stream = this->stream; + event.data = &this->buttonN; + event.data_length = sizeof(this->buttonN); + xine_event_send(this->stream, &event); + spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, 0, + &this->overlay, &this->overlay); + } } else { /* Subtitle and not a menu button */ int i; @@ -858,22 +863,14 @@ static void spudec_print_overlay( vo_overlay_t *ovl ) { } #endif -void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, - vo_overlay_t * overlay, vo_overlay_t * base ) { +int spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, + vo_overlay_t * overlay, vo_overlay_t * base ) { btni_t *button_ptr = NULL; unsigned int btns_per_group; int i; - /* FIXME: Need to communicate with dvdnav vm to get/set - "self->vm->state.HL_BTNN_REG" info. - now done via button events from dvdnav. - * - * if ( this->pci.hli.hl_gi.fosl_btnn > 0) { - * button = this->pci.hli.hl_gi.fosl_btnn ; - * } - */ if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns)) - return; + return 0; btns_per_group = 36 / nav_pci->hli.hl_gi.btngr_ns; @@ -923,5 +920,5 @@ void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n"); #endif + return 1; } - diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h index 0c208d45e..71ecd99c9 100644 --- a/src/libspudec/spu.h +++ b/src/libspudec/spu.h @@ -19,7 +19,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: spu.h,v 1.22 2003/08/15 14:36:55 mroi Exp $ + * $Id: spu.h,v 1.23 2003/11/09 21:49:36 mroi Exp $ * * This file was originally part of the OMS program. * @@ -128,7 +128,7 @@ typedef struct spudec_decoder_s { void spudec_reassembly (spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len); void spudec_process( spudec_decoder_t *this, int stream_id); void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf); -void spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, +int spudec_copy_nav_to_overlay(pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode, vo_overlay_t * overlay, vo_overlay_t * base ); #endif |