From: Drew Fisher Date: Fri, 11 Nov 2011 08:29:02 +0000 (-0800) Subject: touchmouse.c: reset the decoder state when a decode error arises. X-Git-Url: https://git.zarvox.org/?a=commitdiff_plain;h=14606fa7fbf1cc0c40dbd2dd12ab77a8c590c039;p=libtouchmouse.git touchmouse.c: reset the decoder state when a decode error arises. Signed-off-by: Drew Fisher --- diff --git a/src/touchmouse.c b/src/touchmouse.c index 30c0189..765802d 100644 --- a/src/touchmouse.c +++ b/src/touchmouse.c @@ -395,6 +395,7 @@ int touchmouse_process_events_timeout(touchmouse_device *dev, int milliseconds) } if (res == DECODER_ERROR) { fprintf(stderr, "Caught error in decoder, aborting!\n"); + reset_decoder(dev); return -1; } res = process_nybble(dev, (r->data[t] & 0xf0) >> 4); @@ -410,6 +411,7 @@ int touchmouse_process_events_timeout(touchmouse_device *dev, int milliseconds) } if (res == DECODER_ERROR) { fprintf(stderr, "Caught error in decoder, aborting!\n"); + reset_decoder(dev); return -1; } }