diff options
-rw-r--r-- | p2pvr/devices/tuner.cpp | 7 | ||||
-rw-r--r-- | p2pvr/devices/tuner.h | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/p2pvr/devices/tuner.cpp b/p2pvr/devices/tuner.cpp index 41a77c3..e7fd2eb 100644 --- a/p2pvr/devices/tuner.cpp +++ b/p2pvr/devices/tuner.cpp @@ -16,17 +16,22 @@ namespace P2PVR { namespace DVB { IceTray::Logging::LoggerPtr TunerI::logger = LOGMANAGER()->getLogger<TunerI>(); -TunerI::TunerI(const boost::filesystem::path & df) : +TunerI::TunerI(const boost::filesystem::path & df, FrontendPtr pfe) : deviceFrontend(df), deviceRoot(df.branch_path()), frontendFD(deviceFrontend, O_RDWR), backgroundThread(NULL) { + if (pfe) { + frontend = pfe; + } + else { struct dvb_frontend_info fe_info; if (ioctl(frontendFD, FE_GET_INFO, &fe_info) < 0) { throw DeviceError(deviceFrontend.string(), strerror(errno), errno); } frontend = FrontendPtr(FrontendFactory::createNew(Frontend::FactoryKey(fe_info.type), this, fe_info)); + } logger->messagebf(LOG::INFO, "%s: Attached to %s (%s, type %s)", __PRETTY_FUNCTION__, deviceRoot, frontend->Info().name, frontend->Type()); } diff --git a/p2pvr/devices/tuner.h b/p2pvr/devices/tuner.h index 7db09e4..8534a3c 100644 --- a/p2pvr/devices/tuner.h +++ b/p2pvr/devices/tuner.h @@ -41,7 +41,7 @@ class TunerI : public Tuner { typedef boost::shared_ptr<IDataSender> BackgroundClient; typedef std::map<int, BackgroundClient> BackgroundClients; - TunerI(const boost::filesystem::path & deviceFrontend); + TunerI(const boost::filesystem::path & deviceFrontend, FrontendPtr = FrontendPtr()); ~TunerI(); void TuneTo(const DVBSI::DeliveryPtr &) override; |