summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMidas <vdrportal_midas@gmx.de>2010-11-05 12:41:07 +0100
committerMidas <vdrportal_midas@gmx.de>2010-11-05 12:41:07 +0100
commite01f4889d18b73e586a00265ba608cdfafc18e03 (patch)
tree6443989e7d573b14006164d3fe8403b1d7d2a618
parentff03def766c15182ffcada0d2e6b57d154bcd0c2 (diff)
downloadvdr-plugin-block-e01f4889d18b73e586a00265ba608cdfafc18e03.tar.gz
vdr-plugin-block-e01f4889d18b73e586a00265ba608cdfafc18e03.tar.bz2
Bugfix: In Parental Guidance mode the plugin deblocked the last
channel if automatic switching reached an end of the channel list. Fixed.
-rw-r--r--block.c2
-rw-r--r--control.c28
2 files changed, 26 insertions, 4 deletions
diff --git a/block.c b/block.c
index 0269839..67ad63c 100644
--- a/block.c
+++ b/block.c
@@ -20,7 +20,7 @@
using namespace std;
-static const char *VERSION = "0.1.0";
+static const char *VERSION = "0.1.0a";
static const char *DESCRIPTION = trNOOP("Block unwanted shows by EPG title");
static const char *MAINMENUENTRY = trNOOP("(De)Block broadcast");
diff --git a/control.c b/control.c
index d10212c..1c7c0b5 100644
--- a/control.c
+++ b/control.c
@@ -61,7 +61,8 @@ cControlBlock::~cControlBlock()
mRequested=false;
}
- if (mSwitch) {
+ if (mSwitch)
+ {
int lastchannel=cSetupBlock::LastAcceptableChannel;
// possibly first or last available channel, fall back to old channel
@@ -77,8 +78,29 @@ cControlBlock::~cControlBlock()
}
}
- if (!cDevice::SwitchChannel(direction) && (lastchannel != 0))
- Channels.SwitchTo(lastchannel);
+ bool switch_success=cDevice::SwitchChannel(direction);
+
+ if (!switch_success)
+ {
+ if (cSetupBlock::ParentalGuidance==1)
+ {
+ direction=-direction;
+ cSetupBlock::user_direction=direction;
+ switch_success=cDevice::SwitchChannel(direction);
+ }
+ else
+ {
+ if (lastchannel != 0)
+ {
+ dsyslog("plugin-block: ERROR: Don't know where to switch - switching to last channel!");
+ switch_success=Channels.SwitchTo(lastchannel);
+ }
+ }
+ if (!switch_success) dsyslog("plugin-block: ERROR: Don't know where to switch - Giving up!");
+
+ }
+
+
}
}