Skip to content

Commit

Permalink
[media] rc-core: add trailing silence in rc-loopback tx
Browse files Browse the repository at this point in the history
If an IR command is sent (using the LIRC userspace) to rc-loopback
which doesn't include a trailing space, the result is that the message
won't be completely decoded. In addition, "leftovers" from a previous
transmission can be left until the next one. Fix this by faking a long
silence after the end of TX data.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
David Härdeman authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent c829f26 commit 08ffff9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/media/rc/rc-loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ static int loop_tx_ir(struct rc_dev *dev, int *txbuf, u32 n)
if (rawir.duration)
ir_raw_event_store_with_filter(dev, &rawir);
}

/* Fake a silence long enough to cause us to go idle */
rawir.pulse = false;
rawir.duration = dev->timeout;
ir_raw_event_store_with_filter(dev, &rawir);

ir_raw_event_handle(dev);

out:
Expand Down

0 comments on commit 08ffff9

Please sign in to comment.