summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-11 12:41:19 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-11 13:20:23 +0200
commit700543b394c4e87e3bc372fb00c221c456c2adf2 (patch)
tree0302ce7047672beca04c56f4f8a07a08f43d6915
parent1df9641621203b9eeb87c269c9e962691398e010 (diff)
downloadvdr-plugin-tvguide-700543b394c4e87e3bc372fb00c221c456c2adf2.tar.gz
vdr-plugin-tvguide-700543b394c4e87e3bc372fb00c221c456c2adf2.tar.bz2
GetLastValidChannel
-rw-r--r--channelgroups.c13
-rw-r--r--channelgroups.h1
-rw-r--r--channeljump.c11
3 files changed, 12 insertions, 13 deletions
diff --git a/channelgroups.c b/channelgroups.c
index 8447ba4..bd9f8f5 100644
--- a/channelgroups.c
+++ b/channelgroups.c
@@ -1,4 +1,5 @@
#include <vector>
+#include "config.h"
#include "channelgroups.h"
cChannelGroups::cChannelGroups(void) {
@@ -145,9 +146,15 @@ void cChannelGroups::CreateGroupGrid(const char *name, int number, int start, in
}
int cChannelGroups::GetLastValidChannel(void) {
- if (channelGroups.size() > 0)
- return channelGroups[channelGroups.size()-1].StopChannel();
- return 0;
+ if (config.hideLastGroup && channelGroups.size() > 0) {
+ return channelGroups[channelGroups.size() - 1].StopChannel();
+ }
+#if VDRVERSNUM >= 20301
+ LOCK_CHANNELS_READ;
+ return Channels->MaxNumber();
+#else
+ return Channels.MaxNumber();
+#endif
}
void cChannelGroups::DumpGroups(void) {
diff --git a/channelgroups.h b/channelgroups.h
index 02b146d..e919123 100644
--- a/channelgroups.h
+++ b/channelgroups.h
@@ -3,6 +3,7 @@
#include <vector>
#include <vdr/channels.h>
+#include "config.h"
#include "channelgroup.h"
// --- cChannelGroups -------------------------------------------------------------
diff --git a/channeljump.c b/channeljump.c
index cf54b8c..f8d99d2 100644
--- a/channeljump.c
+++ b/channeljump.c
@@ -10,16 +10,7 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
pixmapText = NULL;
channel = 0;
- if (!config.hideLastGroup) {
-#if VDRVERSNUM >= 20301
- LOCK_CHANNELS_READ;
- maxChannels = Channels->MaxNumber();
-#else
- maxChannels = Channels.MaxNumber();
-#endif
- } else {
- maxChannels = channelGroups->GetLastValidChannel();
- }
+ maxChannels = channelGroups->GetLastValidChannel();
timeout = Setup.ChannelEntryTimeout;
startTime = cTimeMs::Now();
SetPixmaps();