From ddbed4d7d2b21f2d777ee8cbc22b8fc7c66f8df4 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Wed, 17 Jul 2002 14:59:18 +0000 Subject: button filtering added CVS patchset: 2301 CVS date: 2002/07/17 14:59:18 --- src/dxr3/dxr3_decode_spu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 71bf0c7bc..f969fd490 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.c @@ -17,7 +17,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: dxr3_decode_spu.c,v 1.12 2002/07/16 16:19:58 mroi Exp $ + * $Id: dxr3_decode_spu.c,v 1.13 2002/07/17 14:59:18 mroi Exp $ */ /* dxr3 spu decoder plugin. @@ -85,6 +85,7 @@ typedef struct dxr3_spudec_s { dxr3_spu_stream_state_t spu_stream_state[MAX_SPU_STREAMS]; int menu; /* are we in a menu? */ + int button_filter; pci_t pci; uint32_t buttonN; /* currently highlighted button */ @@ -146,6 +147,7 @@ spu_decoder_t *init_spu_decoder_plugin(int iface_version, xine_t *xine) this->xine = xine; this->fd_spu = 0; this->menu = 0; + this->button_filter = 1; this->pci.hli.hl_gi.hli_ss = 0; this->buttonN = 1; @@ -238,11 +240,12 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) /* menu ahead, remember pci for later evaluation */ xine_fast_memcpy(&this->pci, &pci, sizeof(pci_t)); + this->menu = 1; + this->button_filter = 0; if ((dxr3_spudec_copy_nav_to_btn(this, 0, &btn ) > 0)) if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) printf("dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); - this->menu = 1; } if ((pci.hli.hl_gi.hli_ss == 0) && (this->pci.hli.hl_gi.hli_ss == 1)) { @@ -257,6 +260,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) /* leaving menu */ this->pci.hli.hl_gi.hli_ss = 0; this->menu = 0; + this->button_filter = 1; ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, NULL); write(this->fd_spu, empty_spu, sizeof(empty_spu)); } @@ -429,11 +433,12 @@ static void dxr3_spudec_event_listener(void *this_gen, xine_event_t *event_gen) printf("dxr3_decode_spu: got SPU_BUTTON\n"); #endif this->buttonN = but->buttonN; - if ((but->show > 0) && (dxr3_spudec_copy_nav_to_btn( - this, but->show - 1, &btn) > 0)) + if ((but->show > 0) && !this->button_filter && + (dxr3_spudec_copy_nav_to_btn(this, but->show - 1, &btn) > 0)) if (ioctl(this->fd_spu, EM8300_IOCTL_SPU_BUTTON, &btn)) printf("dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno)); + if (but->show == 2) this->button_filter = 1; #if LOG_BTN printf("dxr3_decode_spu: buttonN = %u\n",but->buttonN); #endif -- cgit v1.2.3