From 8f87fa5569fc718867a2b9837d21dc955ebbbd1f Mon Sep 17 00:00:00 2001 From: James Courtier-Dutton Date: Tue, 23 Apr 2002 21:48:06 +0000 Subject: Small improvement to menu highlights. Once a menu has been activated, it will not move until the next menu appears. CVS patchset: 1769 CVS date: 2002/04/23 21:48:06 --- src/libspudec/spu.c | 4 +++- src/libspudec/spu.h | 3 ++- src/libspudec/xine_decoder.c | 50 ++++++++++++-------------------------------- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index 59e874d9b..82e48eae7 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.34 2002/04/23 20:27:31 jcdutton Exp $ + * $Id: spu.c,v 1.35 2002/04/23 21:48:06 jcdutton Exp $ * */ @@ -147,6 +147,7 @@ void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) { } if (pci.hli.hl_gi.hli_ss == 1) { xine_fast_memcpy(&this->pci, &pci, sizeof(pci_t)); + this->button_filter=1; /******************************* * We should do something about fosl_btnn, but * until we can send the info to dvdnav, ignore it. @@ -158,6 +159,7 @@ void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) { if ( (pci.hli.hl_gi.hli_ss == 0) && (this->pci.hli.hl_gi.hli_ss == 1) ) { xine_fast_memcpy(&this->pci, &pci, sizeof(pci_t)); + this->button_filter=0; /* Hide menu spu between menus */ printf("libspudec:nav:SHOULD HIDE SPU here\n"); if( this->menu_handle < 0 ) { diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h index 5e0694994..d4f64ea15 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.12 2002/04/23 20:27:32 jcdutton Exp $ + * $Id: spu.h,v 1.13 2002/04/23 21:48:06 jcdutton Exp $ * * This file was originally part of the OMS program. * @@ -112,6 +112,7 @@ typedef struct spudec_decoder_s { int output_open; pci_t pci; uint32_t buttonN; /* Current button number for highlights */ + int32_t button_filter; /* Allow highlight changes or not */ } spudec_decoder_t; void spudec_reassembly (spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len); diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index 99be9beb2..28d18d6c0 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -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: xine_decoder.c,v 1.63 2002/04/23 20:27:32 jcdutton Exp $ + * $Id: xine_decoder.c,v 1.64 2002/04/23 21:48:06 jcdutton Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -222,12 +222,22 @@ static void spudec_event_listener(void *this_gen, xine_event_t *event_gen) { but->buttonN, but->show); this->buttonN = but->buttonN; + if (this->button_filter != 1) { + /* Only update highlight is the menu will let us */ + free(overlay_event); + free(overlay); + break; + } + if (but->show == 2) { + this->button_filter = 2; + } overlay_event->object.handle = this->menu_handle; overlay_event->object.pts = this->pci.hli.hl_gi.hli_s_ptm; overlay_event->object.overlay=overlay; overlay_event->event_type = EVENT_MENU_BUTTON; spudec_copy_nav_to_overlay(&this->pci, this->state.clut, this->buttonN, but->show-1, overlay ); } else { + fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n"); overlay_event->object.handle = this->menu_handle; overlay_event->event_type = EVENT_HIDE_MENU; } @@ -235,44 +245,10 @@ static void spudec_event_listener(void *this_gen, xine_event_t *event_gen) { if (this->vo_out) { ovl_instance = this->vo_out->get_overlay_instance (this->vo_out); ovl_instance->add_event (ovl_instance, (void *)overlay_event); - } -/***************** - get current pci_t - get_current_state 0=no actions allowed. - 1=select/activate allowed. - spudec_fill_overlay_button(nav_pci, overlay, but->buttonN, but->show-1); - use button to fill overlay data. - result return 0 = no action. - 1 = show. - 2 = active. If button active, it stays active until next VOBU. - 3 = hide. - overlay_event->object.handle = this->menu_handle; - overlay_event->object.pts = but->pts; - overlay_event->object.overlay=overlay; - overlay_event->event_type = EVENT_MENU_BUTTON; - overlay->clip_top = but->top; - overlay->clip_bottom = but->bottom; - overlay->clip_left = but->left; - overlay->clip_right = but->right; - overlay->clip_color[0] = this->state.clut[but->color[0]]; - overlay->clip_color[1] = this->state.clut[but->color[1]]; - overlay->clip_color[2] = this->state.clut[but->color[2]]; - overlay->clip_color[3] = this->state.clut[but->color[3]]; - overlay->clip_trans[0] = but->trans[0]; - overlay->clip_trans[1] = but->trans[1]; - overlay->clip_trans[2] = but->trans[2]; - overlay->clip_trans[3] = but->trans[3]; - overlay->clip_rgb_clut = 0; } else { - overlay_event->object.handle = this->menu_handle; - overlay_event->event_type = EVENT_HIDE_MENU; - } - overlay_event->vpts = 0; - if (this->vo_out) { - ovl_instance = this->vo_out->get_overlay_instance (this->vo_out); - ovl_instance->add_event (ovl_instance, (void *)overlay_event); + free(overlay_event); + free(overlay); } -****************/ } break; case XINE_EVENT_SPU_CLUT: -- cgit v1.2.3