mirror of
https://github.com/rofafor/vdr-plugin-femon.git
synced 2023-10-10 13:36:53 +02:00
Check for SAT>IP devices first.
This commit is contained in:
parent
e043190855
commit
667da1f5fe
82
femonosd.c
82
femonosd.c
@ -725,29 +725,28 @@ void cFemonOsd::Show(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
||||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
|
||||||
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||||
if (m_Frontend >= 0) {
|
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
if (m_Frontend >= 0) {
|
||||||
if (!femonConfig.usesvdrp)
|
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||||
error("cFemonOsd::Show() cannot read frontend info.");
|
if (!femonConfig.usesvdrp)
|
||||||
close(m_Frontend);
|
error("cFemonOsd::Show() cannot read frontend info.");
|
||||||
m_Frontend = -1;
|
close(m_Frontend);
|
||||||
memset(&m_FrontendInfo, 0, sizeof(m_FrontendInfo));
|
m_Frontend = -1;
|
||||||
|
memset(&m_FrontendInfo, 0, sizeof(m_FrontendInfo));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (femonConfig.usesvdrp) {
|
||||||
|
if (!SvdrpConnect() || !SvdrpTune())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
error("cFemonOsd::Show() cannot open frontend device.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
|
|
||||||
// nop
|
|
||||||
}
|
|
||||||
else if (femonConfig.usesvdrp) {
|
|
||||||
if (!SvdrpConnect() || !SvdrpTune())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
error("cFemonOsd::Show() cannot open frontend device.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_Frontend = -1;
|
m_Frontend = -1;
|
||||||
@ -785,7 +784,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
|||||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||||
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||||
|
|
||||||
if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber)
|
if (!device || !liveView || !channelNumber || !channel || channel->Number() != channelNumber)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_DeviceSource = DEVICESOURCE_DVBAPI;
|
m_DeviceSource = DEVICESOURCE_DVBAPI;
|
||||||
@ -802,29 +801,28 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
||||||
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
if (!strstr(*device->DeviceType(), SATIP_DEVICE)) {
|
||||||
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
|
||||||
if (m_Frontend >= 0) {
|
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
|
||||||
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
if (m_Frontend >= 0) {
|
||||||
if (!femonConfig.usesvdrp)
|
if (ioctl(m_Frontend, FE_GET_INFO, &m_FrontendInfo) < 0) {
|
||||||
error("cFemonOsd::ChannelSwitch() cannot read frontend info.");
|
if (!femonConfig.usesvdrp)
|
||||||
close(m_Frontend);
|
error("cFemonOsd::ChannelSwitch() cannot read frontend info.");
|
||||||
m_Frontend = -1;
|
close(m_Frontend);
|
||||||
memset(&m_FrontendInfo, 0, sizeof(m_FrontendInfo));
|
m_Frontend = -1;
|
||||||
|
memset(&m_FrontendInfo, 0, sizeof(m_FrontendInfo));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (femonConfig.usesvdrp) {
|
||||||
|
if (!SvdrpConnect() || !SvdrpTune())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
error("cFemonOsd::ChannelSwitch() cannot open frontend device.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
|
|
||||||
// nop
|
|
||||||
}
|
|
||||||
else if (femonConfig.usesvdrp) {
|
|
||||||
if (!SvdrpConnect() || !SvdrpTune())
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
error("cFemonOsd::ChannelSwitch() cannot open frontend device.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Receiver) {
|
if (m_Receiver) {
|
||||||
@ -917,7 +915,6 @@ bool cFemonOsd::DeviceSwitch(int direction)
|
|||||||
}
|
}
|
||||||
// Do the actual switch if valid device found
|
// Do the actual switch if valid device found
|
||||||
if (d && ValidDevice) {
|
if (d && ValidDevice) {
|
||||||
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), 0, true);
|
|
||||||
cControl::Shutdown();
|
cControl::Shutdown();
|
||||||
if (NeedsDetachAllReceivers)
|
if (NeedsDetachAllReceivers)
|
||||||
d->DetachAllReceivers();
|
d->DetachAllReceivers();
|
||||||
@ -936,7 +933,6 @@ bool cFemonOsd::DeviceSwitch(int direction)
|
|||||||
if (d == cDevice::PrimaryDevice())
|
if (d == cDevice::PrimaryDevice())
|
||||||
d->ForceTransferMode();
|
d->ForceTransferMode();
|
||||||
cControl::Launch(new cTransferControl(d, channel));
|
cControl::Launch(new cTransferControl(d, channel));
|
||||||
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number(), true);
|
|
||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user