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:
parent
7f1e5130a6
commit
749e3e3238
1
HISTORY
1
HISTORY
@ -518,3 +518,4 @@ VDR Plugin 'femon' Revision History
|
||||
- Updated for vdr-2.1.8.
|
||||
- Updated CA definitions.
|
||||
- Fixed the SVDRP service IP menu item (Thanks to Toerless Eckert).
|
||||
- Fixed the detaching of receiver during a channel switch.
|
||||
|
18
femonosd.c
18
femonosd.c
@ -784,16 +784,23 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
|
||||
if (!device || !liveView || !channelNumber || !channel || channel->Number() != channelNumber)
|
||||
if (!device || !liveView)
|
||||
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;
|
||||
if (channel) {
|
||||
if (channel->IsSourceType('I'))
|
||||
m_DeviceSource = DEVICESOURCE_IPTV;
|
||||
else if (channel->IsSourceType('V'))
|
||||
m_DeviceSource = DEVICESOURCE_PVRINPUT;
|
||||
}
|
||||
|
||||
if (m_Frontend >= 0) {
|
||||
close(m_Frontend);
|
||||
@ -801,7 +808,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
||||
}
|
||||
|
||||
if (m_DeviceSource == DEVICESOURCE_DVBAPI) {
|
||||
if (!strstr(*device->DeviceType(), SATIP_DEVICE)) {
|
||||
if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
|
||||
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) {
|
||||
@ -823,17 +830,16 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_Receiver) {
|
||||
m_Receiver->Deactivate();
|
||||
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);
|
||||
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user