From 7a2fff05b24866ab8a6578b351a50e6ddb384d60 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Mar 2011 10:35:37 +0000 Subject: [PATCH] neutrino: fix recording from standby After the parental PIN fixes, zapit did no longer zap on leaving standby in order to not bypass the parental PIN code. Unfortunately this broke recording from soft standby if the channel to be recorded was the same as the live channel before standby, since on wakeup it was not tuned. Fix this by tuning the channel on zapit:leaveStandby(), but without starting playback. Playback start is triggered by neutrino including the PIN check. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1314 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f43ce769b62662d0c4095711c9c3c473b389778 Author: Stefan Seyfried Date: 2011-03-20 (Sun, 20 Mar 2011) ------------------ This commit was generated by Migit --- src/neutrino.cpp | 18 ++++++++++++------ src/zapit/src/zapit.cpp | 9 ++++----- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e2e298e2a..32a2a00d7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3993,12 +3993,18 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); g_Zapit->setStandby(false); - if(was_record) - g_Zapit->startPlayBack(); - else { - channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ - channelList->zapTo_ChannelID(live_channel_id); - } + /* the old code did: + if(was_record) g_Zapit->startPlayBack() + unfortunately this bypasses the parental PIN code check if a record timer + was set on a locked channel, then the box put in standby and after the + recording started, the box was woken up. + The channelList->setSelected(); channelList->zapTo_ChannelID() sequence + does trigger the PIN check + If the channel is the same (as during a recording), then it will only + check PIN and not zap, so we should be fine here + */ + channelList->setSelected(0xfffffff); /* make sure that zapTo_ChannelID will zap */ + channelList->zapTo_ChannelID(live_channel_id); if(recordingstatus) was_record = 0; videoDecoder->Standby(false); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index d9cacb238..07f45e2cf 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -387,7 +387,7 @@ void start_camd(bool forupdate = false) static int pmt_update_fd = -1; static bool update_pmt = true; -int zapit(const t_channel_id channel_id, bool in_nvod, bool forupdate = 0, bool /*nowait*/ = 0) +int zapit(const t_channel_id channel_id, bool in_nvod, bool forupdate = 0, bool startplayback = true) { bool transponder_change = false; tallchans_iterator cit; @@ -592,7 +592,7 @@ printf("[zapit] saving channel, apid %x sub pid %x mode %d volume %d\n", g_curre audioDecoder->setChannel(audio_mode); } - if (!we_playing) + if (!we_playing && startplayback) startPlayBack(g_current_channel); printf("[zapit] sending capmt....\n"); @@ -2088,10 +2088,9 @@ void leaveStandby(void) } standby = false; -#if 0 if (g_current_channel) - zapit(live_channel_id, current_is_nvod, false, true); -#endif + /* tune channel, with stopped playback to not bypass the parental PIN check */ + zapit(live_channel_id, current_is_nvod, false, false); } unsigned zapTo(const unsigned int bouquet, const unsigned int pchannel)