m_knownChannels.insert( std::pair<iDVBChannel*, channel_data>(chan, channel_data()) );
tmp.first->second.tdt = NULL;
tmp.first->second.channel = chan;
+ tmp.first->second.m_prevChannelState = -1;
chan->connectStateChange(slot(*this, &eDVBLocalTimeHandler::DVBChannelStateChanged), tmp.first->second.m_stateChangedConn);
}
}
{
int state=0;
chan->getState(state);
- switch (state)
+ if ( state != it->second.m_prevChannelState )
{
- case iDVBChannel::state_ok:
- eDebug("[eDVBLocalTimerHandler] channel %p running", chan);
- it->second.tdt = new TDT(it->second.channel);
- it->second.tdt->start();
- break;
- case iDVBChannel::state_release:
- eDebug("[eDVBLocalTimerHandler] remove channel %p", chan);
- delete it->second.tdt;
- m_knownChannels.erase(it);
- break;
+ switch (state)
+ {
+ case iDVBChannel::state_ok:
+ eDebug("[eDVBLocalTimerHandler] channel %p running", chan);
+ it->second.tdt = new TDT(it->second.channel);
+ it->second.tdt->start();
+ break;
+ case iDVBChannel::state_release:
+ eDebug("[eDVBLocalTimerHandler] remove channel %p", chan);
+ delete it->second.tdt;
+ m_knownChannels.erase(it);
+ break;
+ default: // ignore all other events
+ return;
+ }
+ it->second.m_prevChannelState = state;
}
}
}
TDT *tdt;
ePtr<eDVBChannel> channel;
ePtr<eConnection> m_stateChangedConn;
+ int m_prevChannelState;
};
friend class TDT;
DECLARE_REF(eDVBLocalTimeHandler)
// eDebug("[eEPGCache] add channel %p", chan);
channel_data *data = new channel_data(this);
data->channel = chan;
+ data->prevChannelState = -1;
singleLock s(channel_map_lock);
m_knownChannels.insert( std::pair<iDVBChannel*, channel_data* >(chan, data) );
chan->connectStateChange(slot(*this, &eEPGCache::DVBChannelStateChanged), data->m_stateChangedConn);
{
int state=0;
chan->getState(state);
- switch (state)
+ if ( it->second->prevChannelState != state )
{
- case iDVBChannel::state_ok:
+ switch (state)
{
- eDebug("[eEPGCache] channel %p running", chan);
- DVBChannelRunning(chan);
- break;
- }
- case iDVBChannel::state_release:
- {
- eDebug("[eEPGCache] remove channel %p", chan);
- messages.send(Message(Message::leaveChannel, chan));
- while(!it->second->can_delete)
- usleep(1000);
- delete it->second;
- m_knownChannels.erase(it);
- // -> gotMessage -> abortEPG
- break;
+ case iDVBChannel::state_ok:
+ {
+ eDebug("[eEPGCache] channel %p running", chan);
+ DVBChannelRunning(chan);
+ break;
+ }
+ case iDVBChannel::state_release:
+ {
+ eDebug("[eEPGCache] remove channel %p", chan);
+ messages.send(Message(Message::leaveChannel, chan));
+ while(!it->second->can_delete)
+ usleep(1000);
+ delete it->second;
+ m_knownChannels.erase(it);
+ // -> gotMessage -> abortEPG
+ break;
+ }
+ default: // ignore all other events
+ return;
}
+ it->second->prevChannelState = state;
}
}
}
channel_data(eEPGCache*);
eEPGCache *cache;
eTimer abortTimer, zapTimer;
+ int prevChannelState;
__u8 state, isRunning, haveData, can_delete;
ePtr<eDVBChannel> channel;
ePtr<eConnection> m_stateChangedConn, m_NowNextConn, m_ScheduleConn, m_ScheduleOtherConn;