mirror of
https://github.com/rofafor/vdr-plugin-femon.git
synced 2023-10-10 13:36:53 +02:00
Added the dynamite compatibility patch (Thanks to Lars Hanisch).
This commit is contained in:
parent
315a3365ba
commit
18840de217
4
HISTORY
4
HISTORY
@ -446,3 +446,7 @@ VDR Plugin 'femon' Revision History
|
||||
|
||||
- Updated for vdr-1.7.27.
|
||||
- Cleaned up compilation warnings again.
|
||||
|
||||
2012-xx-xx: Version 1.7.17
|
||||
|
||||
- Added the dynamite compatibility patch (Thanks to Lars Hanisch).
|
||||
|
6
femon.c
6
femon.c
@ -22,7 +22,7 @@
|
||||
#define GITVERSION ""
|
||||
#endif
|
||||
|
||||
static const char VERSION[] = "1.7.16" GITVERSION;
|
||||
static const char VERSION[] = "1.7.17" GITVERSION;
|
||||
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
|
||||
static const char MAINMENUENTRY[] = trNOOP("Signal Information");
|
||||
|
||||
@ -139,7 +139,7 @@ bool cPluginFemon::Service(const char *Id, void *Data)
|
||||
FemonService_v1_0 *data = (FemonService_v1_0*)Data;
|
||||
if (!cDevice::ActualDevice())
|
||||
return false;
|
||||
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||
data->fe_name = getFrontendName(dev);
|
||||
data->fe_status = getFrontendStatus(dev);
|
||||
data->fe_snr = getSNR(dev);
|
||||
@ -198,7 +198,7 @@ const char **cPluginFemon::SVDRPHelpPages(void)
|
||||
|
||||
cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
|
||||
{
|
||||
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||
if (*Option && isnumber(Option)) {
|
||||
cDvbDevice *dev2 = dynamic_cast<cDvbDevice*>(cDevice::GetDevice(int(strtol(Option, NULL, 10))));
|
||||
if (dev2)
|
||||
|
@ -678,7 +678,7 @@ void cFemonOsd::Show(void)
|
||||
}
|
||||
|
||||
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
||||
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||
if (m_Frontend >= 0) {
|
||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||
@ -752,7 +752,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
||||
}
|
||||
|
||||
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
||||
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
|
||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||
if (m_Frontend >= 0) {
|
||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||
|
10
femontools.c
10
femontools.c
@ -76,6 +76,16 @@ static const char *getUserString(int Value, const tDvbParameterMap *Map)
|
||||
return "---";
|
||||
}
|
||||
|
||||
cDvbDevice *getDvbDevice(cDevice* device)
|
||||
{
|
||||
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(device);
|
||||
#ifdef __DYNAMIC_DEVICE_PROBE
|
||||
if (!dev && device && device->HasSubDevice())
|
||||
dev = dynamic_cast<cDvbDevice*>(device->SubDevice());
|
||||
#endif
|
||||
return dev;
|
||||
}
|
||||
|
||||
cString getFrontendInfo(cDvbDevice *device)
|
||||
{
|
||||
cString info;
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#define FRONTEND_DEVICE "/dev/dvb/adapter%d/frontend%d"
|
||||
|
||||
cDvbDevice *getDvbDevice(cDevice* device);
|
||||
|
||||
cString getFrontendInfo(cDvbDevice *device);
|
||||
cString getFrontendName(cDvbDevice *device);
|
||||
cString getFrontendStatus(cDvbDevice *device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user