From 509329c90a524600be720ed332574fbf6454735e Mon Sep 17 00:00:00 2001 From: Johns Date: Thu, 24 Sep 2015 14:31:51 +0200 Subject: [PATCH] Add support for new API of vdr 2.3.1. --- ChangeLog | 1 + softhddevice.cpp | 30 +++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc3670e..45a0aa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ User johns Date: + Add support for new API of vdr 2.3.1. Fix bug: EnableDPMSatBlackScreen only available with USE_SCREENSAVER. - H264_EOS_TRICKSPEED and USE_MPEG_COMPLETE enabled as default. diff --git a/softhddevice.cpp b/softhddevice.cpp index f9b0983..af4bd73 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -47,6 +47,13 @@ extern "C" #include "codec.h" } +#if APIVERSNUM >= 20301 +#define MURKS -> +#else +#define MURKS . +#define LOCK_CHANNELS_READ do { } while (0) +#endif + ////////////////////////////////////////////////////////////////////////////// /// vdr-plugin version number. @@ -1500,7 +1507,11 @@ class cSoftReceiver:public cReceiver { protected: virtual void Activate(bool); +#if APIVERSNUM >= 20301 + virtual void Receive(const uchar *, int); +#else virtual void Receive(uchar *, int); +#endif public: cSoftReceiver(const cChannel *); ///< receiver constructor virtual ~ cSoftReceiver(); ///< receiver destructor @@ -1634,7 +1645,11 @@ static void PipPesParse(const uint8_t * data, int size, int is_start) ** @param data ts packet ** @param size size (#TS_PACKET_SIZE=188) of tes packet */ +#if APIVERSNUM >= 20301 +void cSoftReceiver::Receive(const uchar * data, int size) +#else void cSoftReceiver::Receive(uchar * data, int size) +#endif { const uint8_t *p; @@ -1726,7 +1741,8 @@ static void NewPip(int channel_nr) if (!channel_nr) { channel_nr = cDevice::CurrentChannel(); } - if (channel_nr && (channel = Channels.GetByNumber(channel_nr)) + LOCK_CHANNELS_READ; + if (channel_nr && (channel = Channels MURKS GetByNumber(channel_nr)) && (device = cDevice::GetDevice(channel, 0, false, false))) { DelPip(); @@ -1772,14 +1788,16 @@ static void PipNextAvailableChannel(int direction) DelPip(); // disable PIP to free the device + LOCK_CHANNELS_READ; while (channel) { bool ndr; cDevice *device; - channel = direction > 0 ? Channels.Next(channel) - : Channels.Prev(channel); + channel = direction > 0 ? Channels MURKS Next(channel) + : Channels MURKS Prev(channel); if (!channel && Setup.ChannelsWrap) { - channel = direction > 0 ? Channels.First() : Channels.Last(); + channel = + direction > 0 ? Channels MURKS First() : Channels MURKS Last(); } if (channel && !channel->GroupSep() && (device = cDevice::GetDevice(channel, 0, false, true)) @@ -1808,7 +1826,9 @@ static void SwapPipChannels(void) NewPip(0); if (channel) { - Channels.SwitchTo(channel->Number()); + LOCK_CHANNELS_READ; + + Channels MURKS SwitchTo(channel->Number()); } }