diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 4079eedab..2263b8582 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -1061,24 +1061,29 @@ bool CNeutrinoEventList::findEvents(void) box.paint(); std::vector v; int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio - for(int channel = 0; channel < channel_nr; channel++) - { - channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; - v.push_back(channel_id); - } + for(int channel = 0; channel < channel_nr; channel++){ + channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->channel_id; + v.push_back(channel_id); + } - std::map ch_id_map; + std::map ch_id_map; std::vector::iterator it; - for (it = v.begin(); it != v.end(); ++it) - { + for (it = v.begin(); it != v.end(); ++it){ ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; } CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword); + + std::map::iterator map_it; CChannelEventList::iterator e; - for ( e=evtlist.begin(); e!=evtlist.end(); ++e ) - { - if(e->channelID) - e->channelID = ch_id_map[e->channelID];//map channelID48 to channelID64 + for ( e=evtlist.begin(); e!=evtlist.end();){ + map_it = ch_id_map.find(e->channelID); + if (map_it != ch_id_map.end()){ + e->channelID = map_it->second;//map channelID48 to channelID + ++e; + } + else{ + evtlist.erase(e);// remove event for not found channels in channelList + } } box.hide(); }