summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2003-11-12 17:52:59 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2003-11-12 17:52:59 +0000
commit9b7983249fc3981822e5fc9d3c9b383c65b4ff74 (patch)
tree7c4c5ab1ef03d904576fc644c811c565dafcc9a1
parent15e93de78fd6a3963db664089b103140402fedc8 (diff)
downloadxine-lib-9b7983249fc3981822e5fc9d3c9b383c65b4ff74.tar.gz
xine-lib-9b7983249fc3981822e5fc9d3c9b383c65b4ff74.tar.bz2
better use saturation to convert an illegal button number to a legal one
CVS patchset: 5724 CVS date: 2003/11/12 17:52:59
-rw-r--r--src/dxr3/dxr3_decode_spu.c7
-rw-r--r--src/libspudec/spu.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 72d4ef05a..853860f85 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.38 2003/11/09 21:49:36 mroi Exp $
+ * $Id: dxr3_decode_spu.c,v 1.39 2003/11/12 17:52:59 mroi Exp $
*/
/* dxr3 spu decoder plugin.
@@ -332,7 +332,10 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "requested button not available\n");
- 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;
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;