From b40f8c014eb56426188db2e6efca48312458617d Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 13 Mar 2016 16:02:26 +0100 Subject: added VDR 2.3.1 compatibility --- coreengine/viewelementscommon.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'coreengine/viewelementscommon.c') diff --git a/coreengine/viewelementscommon.c b/coreengine/viewelementscommon.c index 0f9c85c..2226b77 100644 --- a/coreengine/viewelementscommon.c +++ b/coreengine/viewelementscommon.c @@ -287,18 +287,27 @@ bool cVeDevices::Parse(bool forced) { else deviceLiveTV = primaryDevice->DeviceNumber(); } - //check currently recording devices - for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) { - if (!timer->Recording()) { - continue; - } - if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(timer)) { - const cDevice *recDevice = RecordControl->Device(); - if (recDevice) { - mutexDevices.Lock(); - if (recDevices) - recDevices[recDevice->DeviceNumber()] = true; - mutexDevices.Unlock(); + // check currently recording devices + // BLOCK for LOCK_TIMERS_READ scope !! + { +#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) + LOCK_TIMERS_READ; + const cTimers* timers = Timers; +#else + const cTimers* timers = &Timers; +#endif + for (const cTimer *timer = timers->First(); timer; timer = timers->Next(timer)) { + if (!timer->Recording()) { + continue; + } + if (cRecordControl *RecordControl = cRecordControls::GetRecordControl(timer)) { + const cDevice *recDevice = RecordControl->Device(); + if (recDevice) { + mutexDevices.Lock(); + if (recDevices) + recDevices[recDevice->DeviceNumber()] = true; + mutexDevices.Unlock(); + } } } } -- cgit v1.2.3