mirror of
https://github.com/DigitalDevices/pvr.octonet.git
synced 2023-10-10 13:36:57 +02:00
OctonetData: Use hash for channel nativeId
We previously assumed that the channelId provided by the Octonet would only contain numbers and colons, which unfortunately is not true. The satellite names could contain arbitrary characters, which then caused the conversion to a numeric value to fail, stopping channels from being distinguishable. This caused all EPG events to be mapped to the first channel. Signed-off-by: Julian Scheel <julian@jusst.de>
This commit is contained in:
parent
d7bb865329
commit
020dd98e7b
@ -53,14 +53,8 @@ OctonetData::~OctonetData(void)
|
||||
|
||||
int64_t OctonetData::parseID(std::string id)
|
||||
{
|
||||
int64_t nativeId;
|
||||
size_t strip;
|
||||
/* Strip colons from id */
|
||||
while ((strip = id.find(":")) != std::string::npos)
|
||||
id.erase(strip, 1);
|
||||
|
||||
std::stringstream ids(id);
|
||||
ids >> nativeId;
|
||||
std::hash<std::string> hash_fn;
|
||||
int64_t nativeId = hash_fn(id);
|
||||
|
||||
return nativeId;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user