zapit/src/getservices.cpp: add code to remove channels for the given satellite position,

current live channel skipped to prevent neutrino crashes


Origin commit data
------------------
Commit: c5e1ab04e6
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-03-13 (Thu, 13 Mar 2014)
This commit is contained in:
[CST] Focus
2014-03-13 15:52:33 +04:00
parent af9915b109
commit c00f731567
2 changed files with 16 additions and 0 deletions

View File

@@ -123,6 +123,7 @@ class CServiceManager
void ResetChannelNumbers(bool bouquets = true, bool numbers = false); void ResetChannelNumbers(bool bouquets = true, bool numbers = false);
void RemoveChannel(const t_channel_id channel_id); void RemoveChannel(const t_channel_id channel_id);
void RemovePosition(t_satellite_position satellitePosition);
void RemoveAllChannels(); void RemoveAllChannels();
void RemoveCurrentChannels(); void RemoveCurrentChannels();
void RemoveNVODChannels(); void RemoveNVODChannels();

View File

@@ -164,6 +164,21 @@ void CServiceManager::RemoveAllChannels()
{ {
allchans.clear(); allchans.clear();
} }
void CServiceManager::RemovePosition(t_satellite_position satellitePosition)
{
INFO("delete %d, size before: %d", satellitePosition, allchans.size());
t_channel_id live_id = CZapit::getInstance()->GetCurrentChannelID();
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end();) {
if (it->second.getSatellitePosition() == satellitePosition && live_id != it->first)
allchans.erase(it++);
else
++it;
}
services_changed = true;
INFO("delete %d, size after: %d", satellitePosition, allchans.size());
}
#if 0 #if 0
//never used //never used
void CServiceManager::RemoveNVODChannels() void CServiceManager::RemoveNVODChannels()