mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
zapit: consider sat pos in FindChannel48Pos()
Origin commit data
------------------
Branch: ni/coolstream
Commit: f1c60b376f
Author: TangoCash <eric@loxat.de>
Date: 2023-12-04 (Mon, 04 Dec 2023)
Origin message was:
------------------
- zapit: consider sat pos in FindChannel48Pos()
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -473,7 +473,7 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro
|
|||||||
if (sscanf(bp, "%X:0:%X:%X:%X:%X:%X:0:0:0:", &service, &i1, &i2, &i3, &i4, &satpos) == 6)
|
if (sscanf(bp, "%X:0:%X:%X:%X:%X:%X:0:0:0:", &service, &i1, &i2, &i3, &i4, &satpos) == 6)
|
||||||
{
|
{
|
||||||
tmpid = (((t_channel_id)i3) << 32) | (((t_channel_id)i4) << 16) | (t_channel_id)i2;
|
tmpid = (((t_channel_id)i3) << 32) | (((t_channel_id)i4) << 16) | (t_channel_id)i2;
|
||||||
tmp_channel = CServiceManager::getInstance()->FindChannel48(tmpid);
|
tmp_channel = CServiceManager::getInstance()->FindChannel48Pos(tmpid, satpos >> 16);
|
||||||
if (tmp_channel)
|
if (tmp_channel)
|
||||||
{
|
{
|
||||||
printf("CStreamManager::Parse:E: channel_id %" PRIx64 " [%s] \n", tmp_channel->getChannelID(), tmp_channel->getName().c_str());
|
printf("CStreamManager::Parse:E: channel_id %" PRIx64 " [%s] \n", tmp_channel->getChannelID(), tmp_channel->getName().c_str());
|
||||||
|
@@ -131,6 +131,8 @@ class CServiceManager
|
|||||||
CZapitChannel* FindChannelByPattern(std::string pattern); //NI
|
CZapitChannel* FindChannelByPattern(std::string pattern); //NI
|
||||||
CZapitChannel* FindCurrentChannel(const t_channel_id channel_id);
|
CZapitChannel* FindCurrentChannel(const t_channel_id channel_id);
|
||||||
CZapitChannel* FindChannel48(const t_channel_id channel_id);
|
CZapitChannel* FindChannel48(const t_channel_id channel_id);
|
||||||
|
CZapitChannel* FindChannel48Pos(const t_channel_id channel_id,
|
||||||
|
const t_satellite_position pos);
|
||||||
CZapitChannel* FindChannelFuzzy(const t_channel_id channel_id,
|
CZapitChannel* FindChannelFuzzy(const t_channel_id channel_id,
|
||||||
const t_satellite_position pos, const freq_id_t freq);
|
const t_satellite_position pos, const freq_id_t freq);
|
||||||
|
|
||||||
|
@@ -250,6 +250,19 @@ CZapitChannel * CServiceManager::FindChannel48(const t_channel_id channel_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CZapitChannel* CServiceManager::FindChannel48Pos(const t_channel_id channel_id,
|
||||||
|
const t_satellite_position pos)
|
||||||
|
{
|
||||||
|
for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) {
|
||||||
|
CZapitChannel *ret = &it->second;
|
||||||
|
if ((ret->getChannelID() & 0xFFFFFFFFFFFFULL) != (channel_id & 0xFFFFFFFFFFFFULL))
|
||||||
|
continue;
|
||||||
|
if (pos == ret->getSatellitePosition())
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: those FindChannel* functions are naive at best. By using a different construction
|
/* TODO: those FindChannel* functions are naive at best. By using a different construction
|
||||||
* scheme for the channel_id,they could easily be made much more efficient. Side effects would
|
* scheme for the channel_id,they could easily be made much more efficient. Side effects would
|
||||||
* need to be checked first, though */
|
* need to be checked first, though */
|
||||||
|
Reference in New Issue
Block a user