aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-03-04 20:38:59 +0100
committerghost <andreas.monzner@multimedia-labs.de>2009-03-04 20:38:59 +0100
commit8632fc87741200695d2726b689853b6b550a4b06 (patch)
tree1628bdbbc62506d5c78a83b4a88dd1041c72633b /lib/dvb
parent404743faf9cbf0c70d68ca047f2a8e914a0d94b5 (diff)
downloadenigma2-8632fc87741200695d2726b689853b6b550a4b06.tar.gz
enigma2-8632fc87741200695d2726b689853b6b550a4b06.zip
add possibility to disable the dvb transponder time sync
not via gui yet... but config.misc.useTransponderTime=True/False in /etc/enigma2/settings should work
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/dvbtime.cpp35
-rw-r--r--lib/dvb/dvbtime.h3
2 files changed, 35 insertions, 3 deletions
diff --git a/lib/dvb/dvbtime.cpp b/lib/dvb/dvbtime.cpp
index 89650f25..03847ecb 100644
--- a/lib/dvb/dvbtime.cpp
+++ b/lib/dvb/dvbtime.cpp
@@ -145,7 +145,7 @@ eDVBLocalTimeHandler *eDVBLocalTimeHandler::instance;
DEFINE_REF(eDVBLocalTimeHandler);
eDVBLocalTimeHandler::eDVBLocalTimeHandler()
- :m_updateNonTunedTimer(eTimer::create(eApp)), m_time_ready(false)
+ :m_use_dvb_time(false), m_updateNonTunedTimer(eTimer::create(eApp)), m_time_ready(false)
{
if ( !instance )
instance=this;
@@ -214,6 +214,33 @@ void eDVBLocalTimeHandler::writeTimeOffsetData( const char* filename )
}
}
+void eDVBLocalTimeHandler::setUseDVBTime(bool b)
+{
+ if (m_use_dvb_time != b) {
+ if (m_use_dvb_time) {
+ eDebug("[eDVBLocalTimeHandler] disable sync local time with transponder time!");
+ std::map<iDVBChannel*, channel_data>::iterator it =
+ m_knownChannels.begin();
+ for (; it != m_knownChannels.end(); ++it) {
+ if (it->second.m_prevChannelState == iDVBChannel::state_ok)
+ it->second.tdt = 0;
+ }
+ }
+ else {
+ eDebug("[eDVBLocalTimeHandler] enable sync local time with transponder time!");
+ std::map<iDVBChannel*, channel_data>::iterator it =
+ m_knownChannels.begin();
+ for (; it != m_knownChannels.end(); ++it) {
+ if (it->second.m_prevChannelState == iDVBChannel::state_ok) {
+ it->second.tdt = new TDT(it->second.channel);
+ it->second.tdt->start();
+ }
+ }
+ }
+ m_use_dvb_time = b;
+ }
+}
+
void eDVBLocalTimeHandler::updateNonTuned()
{
updateTime(-1, 0, 0);
@@ -440,8 +467,10 @@ void eDVBLocalTimeHandler::DVBChannelStateChanged(iDVBChannel *chan)
case iDVBChannel::state_ok:
eDebug("[eDVBLocalTimerHandler] channel %p running", chan);
m_updateNonTunedTimer->stop();
- it->second.tdt = new TDT(it->second.channel);
- it->second.tdt->start();
+ if (m_use_dvb_time) {
+ it->second.tdt = new TDT(it->second.channel);
+ it->second.tdt->start();
+ }
break;
case iDVBChannel::state_release:
eDebug("[eDVBLocalTimerHandler] remove channel %p", chan);
diff --git a/lib/dvb/dvbtime.h b/lib/dvb/dvbtime.h
index 3f8d9b7d..3afff75e 100644
--- a/lib/dvb/dvbtime.h
+++ b/lib/dvb/dvbtime.h
@@ -54,6 +54,7 @@ class eDVBLocalTimeHandler: public Object
ePtr<eConnection> m_stateChangedConn;
int m_prevChannelState;
};
+ bool m_use_dvb_time;
ePtr<eTimer> m_updateNonTunedTimer;
friend class TDT;
std::map<iDVBChannel*, channel_data> m_knownChannels;
@@ -78,6 +79,8 @@ public:
eDVBLocalTimeHandler();
~eDVBLocalTimeHandler();
#endif
+ bool getUseDVBTime() { return m_use_dvb_time; }
+ void setUseDVBTime(bool b);
PSignal0<void> m_timeUpdated;
bool ready() const { return m_time_ready; }
static eDVBLocalTimeHandler *getInstance() { return instance; }