From 9b7983249fc3981822e5fc9d3c9b383c65b4ff74 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Wed, 12 Nov 2003 17:52:59 +0000 Subject: better use saturation to convert an illegal button number to a legal one CVS patchset: 5724 CVS date: 2003/11/12 17:52:59 --- src/libspudec/spu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/libspudec/spu.c') diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index d86787e63..2270f6bb3 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.70 2003/11/09 21:49:36 mroi Exp $ + * $Id: spu.c,v 1.71 2003/11/12 17:53:01 mroi Exp $ * */ @@ -382,7 +382,10 @@ void spudec_process (spudec_decoder_t *this, int stream_id) { /* current button does not exist -> use another one */ xine_event_t event; - this->buttonN = 1; + if (this->buttonN > this->pci.hli.hl_gi.btn_ns) + this->buttonN = this->pci.hli.hl_gi.btn_ns; + else + this->buttonN = 1; event.type = XINE_EVENT_INPUT_BUTTON_FORCE; event.stream = this->stream; event.data = &this->buttonN; -- cgit v1.2.3