1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 13:36:53 +02:00

Fixed the detaching of receiver during a channel switch.

This commit is contained in:
Rolf Ahrenberg 2015-02-08 19:55:36 +02:00
parent 7f1e5130a6
commit 749e3e3238
2 changed files with 43 additions and 36 deletions

View File

@ -518,3 +518,4 @@ VDR Plugin 'femon' Revision History
- Updated for vdr-2.1.8. - Updated for vdr-2.1.8.
- Updated CA definitions. - Updated CA definitions.
- Fixed the SVDRP service IP menu item (Thanks to Toerless Eckert). - Fixed the SVDRP service IP menu item (Thanks to Toerless Eckert).
- Fixed the detaching of receiver during a channel switch.

View File

@ -784,16 +784,23 @@ 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 (!device || !liveView || !channelNumber || !channel || channel->Number() != channelNumber) if (!device || !liveView)
return; return;
if (!channelNumber || !channel || channel->Number() != channelNumber) {
if (m_Receiver) {
m_Receiver->Deactivate();
DELETENULL(m_Receiver);
}
return;
}
if (channel && femonConfig.analyzestream) {
m_DeviceSource = DEVICESOURCE_DVBAPI; m_DeviceSource = DEVICESOURCE_DVBAPI;
if (channel) {
if (channel->IsSourceType('I')) if (channel->IsSourceType('I'))
m_DeviceSource = DEVICESOURCE_IPTV; m_DeviceSource = DEVICESOURCE_IPTV;
else if (channel->IsSourceType('V')) else if (channel->IsSourceType('V'))
m_DeviceSource = DEVICESOURCE_PVRINPUT; m_DeviceSource = DEVICESOURCE_PVRINPUT;
}
if (m_Frontend >= 0) { if (m_Frontend >= 0) {
close(m_Frontend); close(m_Frontend);
@ -801,7 +808,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
} }
if (m_DeviceSource == DEVICESOURCE_DVBAPI) { if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
if (!strstr(*device->DeviceType(), SATIP_DEVICE)) { if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice()); cDvbDevice *dev = getDvbDevice(cDevice::ActualDevice());
m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1; m_Frontend = dev ? open(*cString::sprintf(FRONTEND_DEVICE, dev->Adapter(), dev->Frontend()), O_RDONLY | O_NONBLOCK) : -1;
if (m_Frontend >= 0) { if (m_Frontend >= 0) {
@ -823,16 +830,15 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
return; return;
} }
} }
}
if (m_Receiver) { if (m_Receiver) {
m_Receiver->Deactivate(); m_Receiver->Deactivate();
DELETENULL(m_Receiver); DELETENULL(m_Receiver);
} }
if (femonConfig.analyzestream && channel) {
m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0); m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver); cDevice::ActualDevice()->AttachReceiver(m_Receiver);
} }
}
} }
void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks) void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks)