change transpoder ctor to use transponder_id

This commit is contained in:
[CST] Focus
2012-04-10 14:33:55 +04:00
parent 73906e3591
commit 020958db6a
4 changed files with 22 additions and 16 deletions

View File

@@ -41,10 +41,11 @@ struct transponder
{
t_transport_stream_id transport_stream_id;
t_original_network_id original_network_id;
transponder_id_t transponder_id;
struct dvb_frontend_parameters feparams;
unsigned char polarization;
bool updated;
#if 0
transponder(const t_transport_stream_id p_transport_stream_id, const t_original_network_id p_original_network_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0)
{
transport_stream_id = p_transport_stream_id;
@@ -53,6 +54,16 @@ struct transponder
polarization = p_polarization;
updated = 0;
}
#endif
transponder(const transponder_id_t t_id, const struct dvb_frontend_parameters p_feparams, const uint8_t p_polarization = 0)
{
transponder_id = t_id;
transport_stream_id = (t_id >> 16) & 0xFFFF;
original_network_id = t_id & 0xFFFF;
feparams = p_feparams;
polarization = p_polarization;
updated = 0;
}
};
typedef std::map <transponder_id_t, transponder> transponder_list_t;

View File

@@ -482,9 +482,8 @@ bool CServiceScan::ParseFnt(unsigned short pid, unsigned short operator_id)
transponders.insert (
std::pair <transponder_id_t, transponder> (
TsidOnid,
transponder (
transport_stream_id,
original_network_id,
transponder(
TsidOnid,
feparams,
polarization
)

View File

@@ -115,7 +115,7 @@ bool CServiceManager::AddNVODChannel(CZapitChannel * &channel)
t_satellite_position satellitePosition = channel->getSatellitePosition();
t_channel_id sub_channel_id =
((uint64_t) ( satellitePosition >= 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) |
(uint64_t) CREATE_CHANNEL_ID_FROM_SERVICE_ORIGINALNETWORK_TRANSPORTSTREAM_ID(service_id, original_network_id, transport_stream_id);
(uint64_t) CREATE_CHANNEL_ID(service_id, original_network_id, transport_stream_id);
channel_insert_res_t ret = nvodchannels.insert (
channel_pair_t (sub_channel_id, *channel));
@@ -330,10 +330,8 @@ void CServiceManager::ParseTransponders(xmlNodePtr node, t_satellite_position sa
pair<map<transponder_id_t, transponder>::iterator,bool> ret;
ret = transponders.insert (
std::pair <transponder_id_t, transponder> ( tid,
transponder (transport_stream_id, original_network_id,
feparams, polarization)
)
std::pair <transponder_id_t, transponder> (tid,
transponder(tid, feparams, polarization))
);
if (ret.second == false)
printf("[zapit] duplicate transponder id %llx freq %d\n", tid, feparams.frequency);
@@ -502,7 +500,7 @@ void CServiceManager::ParseSatTransponders(fe_type_t fType, xmlNodePtr search, t
polarization &= 1;
select_transponders.insert (
std::pair <transponder_id_t, transponder> (tid,
transponder (fake_tid, fake_nid, feparams, polarization))
transponder (tid, feparams, polarization))
);
fake_nid ++; fake_tid ++;

View File

@@ -196,8 +196,7 @@ bool CServiceScan::AddTransponder(transponder_id_t TsidOnid, FrontendParameters
nittransponders.insert (
std::pair <transponder_id_t, transponder> (
TsidOnid,
transponder ( (TsidOnid >> 16) &0xFFFF,
TsidOnid &0xFFFF, *feparams, polarity)));
transponder (TsidOnid, *feparams, polarity)));
}
}
else {
@@ -205,11 +204,11 @@ bool CServiceScan::AddTransponder(transponder_id_t TsidOnid, FrontendParameters
scantransponders.insert (
std::pair <transponder_id_t, transponder> (
TsidOnid,
transponder ( (TsidOnid >> 16) &0xFFFF, TsidOnid &0xFFFF, *feparams, polarity)));
transponder(TsidOnid, *feparams, polarity)));
scanedtransponders.insert (
std::pair <transponder_id_t, transponder> (
TsidOnid,
transponder ( (TsidOnid >> 16) &0xFFFF, TsidOnid &0xFFFF, *feparams, polarity)));
transponder(TsidOnid, *feparams, polarity)));
}
return true;
}
@@ -320,8 +319,7 @@ _repeat:
std::pair <transponder_id_t, transponder> (
TsidOnid,
transponder (
tI->second.transport_stream_id,
tI->second.original_network_id,
TsidOnid,
tI->second.feparams,
tI->second.polarization
)