mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libarmbox: hdmi_cec fix device
Origin commit data
------------------
Branch: master
Commit: 851163927e
Author: TangoCash <eric@loxat.de>
Date: 2018-10-09 (Tue, 09 Oct 2018)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <sys/poll.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -110,7 +111,7 @@ bool hdmi_cec::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType)
|
|||||||
|
|
||||||
if (hdmiFd == -1)
|
if (hdmiFd == -1)
|
||||||
{
|
{
|
||||||
hdmiFd = open(CEC_DEVICE, O_RDWR | O_NONBLOCK);
|
hdmiFd = open(CEC_DEVICE, O_RDWR | O_CLOEXEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdmiFd >= 0)
|
if (hdmiFd >= 0)
|
||||||
@@ -462,6 +463,8 @@ bool hdmi_cec::Stop()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
running = false;
|
running = false;
|
||||||
|
|
||||||
|
OpenThreads::Thread::cancel();
|
||||||
|
|
||||||
if (hdmiFd >= 0)
|
if (hdmiFd >= 0)
|
||||||
{
|
{
|
||||||
@@ -474,9 +477,16 @@ bool hdmi_cec::Stop()
|
|||||||
|
|
||||||
void hdmi_cec::run()
|
void hdmi_cec::run()
|
||||||
{
|
{
|
||||||
while (running && (hdmiFd >= 0))
|
OpenThreads::Thread::setCancelModeAsynchronous();
|
||||||
|
struct pollfd pfd;
|
||||||
|
|
||||||
|
pfd.fd = hdmiFd;
|
||||||
|
pfd.events = (POLLIN | POLLPRI);
|
||||||
|
|
||||||
|
while (running)
|
||||||
{
|
{
|
||||||
Receive();
|
if (poll(&pfd, 1, 0) > 0)
|
||||||
|
Receive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user