From 9b243ac94f57cbc35384a4076a73b937e15e356f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 4 Aug 2017 23:58:46 +0100 Subject: Move the frontend file descriptor ownership into the parent tuner as an AdHoc FileHandle --- p2pvr/devices/frontend.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'p2pvr/devices/frontend.cpp') 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 &); -- cgit v1.2.3