Revert "libstb-hal: Fix compatibility issues with struct input_event time assignment"

This reverts commit 9183928d85.
This commit is contained in:
2024-06-27 09:10:42 +02:00
parent 9183928d85
commit eb9ec0be3e

View File

@@ -790,42 +790,13 @@ void hdmi_cec::rc_sync(int fd)
{
struct input_event ev;
struct timeval tv;
gettimeofday(&tv, NULL);
// Depending on the structure definition in input.h, assign the time values
#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__)
ev.time.tv_sec = tv.tv_sec;
ev.time.tv_usec = tv.tv_usec;
#else
ev.__sec = tv.tv_sec;
ev.__usec = tv.tv_usec;
#endif
gettimeofday(&ev.time, NULL);
ev.type = EV_SYN;
ev.code = SYN_REPORT;
ev.value = 0;
ssize_t bytes_written = write(fd, &ev, sizeof(ev));
// Debugging information
if (bytes_written != sizeof(ev))
{
hal_info(RED "[CEC] Error writing sync event to device\n" NORMAL);
}
else
{
hal_info(GREEN "[CEC] Sync event written successfully\n" NORMAL);
#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) && !defined(__KERNEL__)
hal_info(GREEN "[CEC] Event time: %ld.%06ld\n" NORMAL, ev.time.tv_sec, ev.time.tv_usec);
#else
hal_info(GREEN "[CEC] Event time: %ld.%06ld\n" NORMAL, ev.__sec, ev.__usec);
#endif
}
write(fd, &ev, sizeof(ev));
}
void hdmi_cec::send_key(unsigned char key, unsigned char destination)
{
struct cec_message txmessage;