Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91352b57 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab
Browse files

media: rc: mceusb: IR of length 0 means IR timeout, not reset



The last usb packet with IR data will end with 0x80 (MCE_IRDATA_TRAILER).
If we reset the decoder state at this point, IR decoding can fail.

Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 53a62800
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,12 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
			if (ir->rem) {
				ir->parser_state = PARSE_IRDATA;
			} else {
				ir_raw_event_reset(ir->rc);
				init_ir_raw_event(&rawir);
				rawir.timeout = 1;
				rawir.duration = ir->rc->timeout;
				if (ir_raw_event_store_with_filter(ir->rc,
								   &rawir))
					event = true;
				ir->pulse_tunit = 0;
				ir->pulse_count = 0;
			}