diff --git a/HISTORY b/HISTORY index f0f99e5..0739603 100644 --- a/HISTORY +++ b/HISTORY @@ -384,7 +384,8 @@ VDR Plugin 'femon' Revision History - Removed bitstream parsing from Receive() method. - Added Chinese translation (Thanks to NanFeng). -2009-xx-xx: Version 1.7.6 +2010-02-01: Version 1.7.6 +- Updated for vdr-1.7.12. - Updated Estonian translation (Thanks to Arthur Konovalov). - Added Lithuanian translation (Thanks to Valdemaras Pipiras). diff --git a/femon.c b/femon.c index cb8c1c4..72d6b19 100644 --- a/femon.c +++ b/femon.c @@ -14,8 +14,8 @@ #include "femonservice.h" #include "femontools.h" -#if defined(APIVERSNUM) && APIVERSNUM < 10700 -#error "VDR-1.7.0 API version or greater is required!" +#if defined(APIVERSNUM) && APIVERSNUM < 10712 +#error "VDR-1.7.12 API version or greater is required!" #endif static const char VERSION[] = "1.7.6"; diff --git a/femonosd.c b/femonosd.c index 379e739..d30df81 100644 --- a/femonosd.c +++ b/femonosd.c @@ -575,8 +575,6 @@ void cFemonOsd::Action(void) void cFemonOsd::Show(void) { debug("%s()\n", __PRETTY_FUNCTION__); - int apid[2] = {0, 0}; - int dpid[2] = {0, 0}; eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); cString dev = cString::sprintf(FRONTEND_DEVICE, cDevice::ActualDevice()->CardIndex(), 0); m_Frontend = open(dev, O_RDONLY | O_NONBLOCK); @@ -621,9 +619,7 @@ void cFemonOsd::Show(void) if (femonConfig.analyzestream) { cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); if (channel) { - IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0); - IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0); - m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid); + m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); cDevice::ActualDevice()->AttachReceiver(m_Receiver); } } @@ -634,8 +630,6 @@ void cFemonOsd::Show(void) void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber) { debug("%s(%d,%d)\n", __PRETTY_FUNCTION__, device->DeviceNumber(), channelNumber); - int apid[2] = {0, 0}; - int dpid[2] = {0, 0}; eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); if (!device->IsPrimaryDevice() || !channelNumber || cDevice::PrimaryDevice()->CurrentChannel() != channelNumber) return; @@ -668,9 +662,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber) if (femonConfig.analyzestream) { cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); if (channel) { - IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0); - IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0); - m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid); + m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); cDevice::ActualDevice()->AttachReceiver(m_Receiver); } } @@ -679,8 +671,6 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber) void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks) { debug("%s()\n", __PRETTY_FUNCTION__); - int apid[2] = {0, 0}; - int dpid[2] = {0, 0}; eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); if (m_Receiver) { m_Receiver->Deactivate(); @@ -689,9 +679,7 @@ void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks) if (femonConfig.analyzestream) { cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); if (channel) { - IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0); - IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0); - m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid); + m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); cDevice::ActualDevice()->AttachReceiver(m_Receiver); } } @@ -721,7 +709,7 @@ bool cFemonOsd::DeviceSwitch(int direction) cDevice::GetDevice(device)->SwitchChannel(channel, true); if (cDevice::GetDevice(device) == cDevice::PrimaryDevice()) cDevice::GetDevice(device)->ForceTransferMode(); - cControl::Launch(new cTransferControl(cDevice::GetDevice(device), channel->GetChannelID(), channel->Vpid(), channel->Apids(), channel->Dpids(), channel->Spids())); + cControl::Launch(new cTransferControl(cDevice::GetDevice(device), channel)); cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number()); return (true); } diff --git a/femonreceiver.c b/femonreceiver.c index ce9b9dc..d53c0bc 100644 --- a/femonreceiver.c +++ b/femonreceiver.c @@ -10,9 +10,8 @@ #include "femoncfg.h" #include "femonreceiver.h" -cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vtype, int Vpid, int Apid[], int Dpid[]) -: cReceiver(ChannelID, -1, Vpid, Apid, Dpid, NULL), - cThread("femon receiver"), +cFemonReceiver::cFemonReceiver(int Vtype, int Vpid, int Apid, int Dpid) +: cThread("femon receiver"), m_Mutex(), m_Sleep(), m_Active(false), @@ -27,18 +26,22 @@ cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vtype, int Vpid m_VideoBitrate(0.0), m_VideoValid(false), m_AudioBuffer(KILOBYTE(256), TS_SIZE, false, "Femon audio"), - m_AudioPid(Apid[0]), + m_AudioPid(Apid), m_AudioPacketCount(0), m_AudioBitrate(0.0), m_AudioValid(false), m_AC3Buffer(KILOBYTE(256), TS_SIZE, false, "Femon AC3"), - m_AC3Pid(Dpid[0]), + m_AC3Pid(Dpid), m_AC3PacketCount(0), m_AC3Bitrate(0), m_AC3Valid(false) { debug("%s()\n", __PRETTY_FUNCTION__); + AddPid(m_VideoPid); + AddPid(m_AudioPid); + AddPid(m_AC3Pid); + m_VideoBuffer.SetTimeouts(0, 100); m_AudioBuffer.SetTimeouts(0, 100); m_AC3Buffer.SetTimeouts(0, 100); diff --git a/femonreceiver.h b/femonreceiver.h index 99f4309..2749ac3 100644 --- a/femonreceiver.h +++ b/femonreceiver.h @@ -106,7 +106,7 @@ public: m_AC3Info.lfe = onoff; } public: - cFemonReceiver(tChannelID ChannelID, int Ca, int Vtype, int Vpid, int Apid[], int Dpid[]); + cFemonReceiver(int Vtype, int Vpid, int Apid, int Dpid); virtual ~cFemonReceiver(); void Deactivate(void);