summaryrefslogtreecommitdiff
path: root/display.c
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-21 21:31:57 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-21 21:31:57 +0200
commit627afe268e2ceaeca3d4d2dea51401019f7a10bf (patch)
tree84b0a82b4eb0745d12fcdeca2d0ee94166e3084c /display.c
parent8b83687aa11aabdf7e2c78bf22b48efe2bdd4403 (diff)
downloadvdr-plugin-text2skin-627afe268e2ceaeca3d4d2dea51401019f7a10bf.tar.gz
vdr-plugin-text2skin-627afe268e2ceaeca3d4d2dea51401019f7a10bf.tar.bz2
Add compatibility for VDR API >= 2.3.1.
Diffstat (limited to 'display.c')
-rw-r--r--display.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/display.c b/display.c
index d29e36a..30f388e 100644
--- a/display.c
+++ b/display.c
@@ -1118,7 +1118,12 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
if (ExtPresentDescription == "") {
// find corresponding timer
const char *aux = NULL;
+#if APIVERSNUM < 20301
for (cTimer *tim = Timers.First(); tim; tim = Timers.Next(tim))
+#else
+ LOCK_TIMERS_READ;
+ for (const cTimer *tim = Timers->First(); tim; tim = Timers->Next(tim))
+#endif
if (tim->Event() == mEvent)
aux = tim->Aux();
ExtPresentDescription = AddExtInfoToDescription(mEvent->Title(), mEvent->ShortText(), mEvent->Description(), aux, Text2SkinSetup.StripAux);
@@ -1201,14 +1206,24 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tChannelName:
if (mEvent) { // extended EPG
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByChannelID(mEvent->ChannelID(), true);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(mEvent->ChannelID(), true);
+#endif
return channel != NULL
? (cxType)ChannelName(channel, 0)
: (cxType)false;
}
else if (mRecording) { // recording Info
cRecordingInfo *recInfo = const_cast<cRecordingInfo*>(mRecording->Info());
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID(), true);
+#endif
return channel != NULL
? (cxType)ChannelName(channel, 0)
: (cxType)false;
@@ -1217,14 +1232,24 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token)
case tChannelShortName:
if (mEvent) { // extended EPG
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByChannelID(mEvent->ChannelID(), true);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(mEvent->ChannelID(), true);
+#endif
return channel != NULL
? (cxType)ChannelShortName(channel, 0)
: (cxType)false;
}
else if (mRecording) { // recording Info
cRecordingInfo *recInfo = const_cast<cRecordingInfo*>(mRecording->Info());
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID(), true);
+#endif
return channel != NULL
? (cxType)ChannelShortName(channel, 0)
: (cxType)false;