diff options
author | Midas <vdrportal_midas@gmx.de> | 2010-11-05 12:41:07 +0100 |
---|---|---|
committer | Midas <vdrportal_midas@gmx.de> | 2010-11-05 12:41:07 +0100 |
commit | e01f4889d18b73e586a00265ba608cdfafc18e03 (patch) | |
tree | 6443989e7d573b14006164d3fe8403b1d7d2a618 | |
parent | ff03def766c15182ffcada0d2e6b57d154bcd0c2 (diff) | |
download | vdr-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.c | 2 | ||||
-rw-r--r-- | control.c | 28 |
2 files changed, 26 insertions, 4 deletions
@@ -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"); @@ -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!"); + + } + + } } |