diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-08-04 23:58:46 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-08-04 23:58:46 +0100 |
commit | 9b243ac94f57cbc35384a4076a73b937e15e356f (patch) | |
tree | a8de408d8213a9ecf495e190a49fa7e1abd62588 /p2pvr/devices/frontend.cpp | |
parent | Prefer unique_ptr for local SI tables, pass them around as const refs (diff) | |
download | p2pvr-9b243ac94f57cbc35384a4076a73b937e15e356f.tar.bz2 p2pvr-9b243ac94f57cbc35384a4076a73b937e15e356f.tar.xz p2pvr-9b243ac94f57cbc35384a4076a73b937e15e356f.zip |
Move the frontend file descriptor ownership into the parent tuner as an AdHoc FileHandle
Diffstat (limited to 'p2pvr/devices/frontend.cpp')
-rw-r--r-- | p2pvr/devices/frontend.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/p2pvr/devices/frontend.cpp b/p2pvr/devices/frontend.cpp index c368fda..c6f258b 100644 --- a/p2pvr/devices/frontend.cpp +++ b/p2pvr/devices/frontend.cpp @@ -6,9 +6,8 @@ namespace P2PVR { namespace DVB { -Frontend::Frontend(Tuner * t, int fd, const struct dvb_frontend_info & i, IceTray::Logging::LoggerPtr log) : +Frontend::Frontend(Tuner * t, const struct dvb_frontend_info & i, IceTray::Logging::LoggerPtr log) : tuner(t), - frontendFD(fd), fe_info(i), logger(log) { @@ -16,7 +15,6 @@ Frontend::Frontend(Tuner * t, int fd, const struct dvb_frontend_info & i, IceTra Frontend::~Frontend() { - close(frontendFD); } const struct dvb_frontend_info & @@ -29,7 +27,7 @@ fe_status Frontend::GetStatus() const { fe_status_t status; - if (ioctl(frontendFD, FE_READ_STATUS, &status) < 0) { + if (ioctl(tuner->frontendFD, FE_READ_STATUS, &status) < 0) { logger->messagebf(LOG::ERR, "Reading frontend %s status failed (%s:%d)", tuner->Device(), strerror(errno), errno); throw P2PVR::DeviceError(tuner->Device(), strerror(errno), errno); } @@ -44,5 +42,5 @@ Frontend::FactoryKey(fe_type t) } } -INSTANTIATEFACTORY(P2PVR::DVB::Frontend, P2PVR::DVB::Tuner *, int, const struct dvb_frontend_info &); +INSTANTIATEFACTORY(P2PVR::DVB::Frontend, P2PVR::DVB::Tuner *, const struct dvb_frontend_info &); |