mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
speed up starting neutrino while loading xmltv logos
Origin commit data
------------------
Commit: 4e8f173209
Author: TangoCash <eric@loxat.de>
Date: 2018-09-15 (Sat, 15 Sep 2018)
This commit is contained in:
@@ -178,6 +178,8 @@ class CZapitChannel
|
||||
|
||||
void Init();
|
||||
friend class CChannelList;
|
||||
pthread_t thrLogo;
|
||||
static void* LogoThread(void* channel);
|
||||
|
||||
public:
|
||||
typedef enum channel_flags {
|
||||
@@ -296,6 +298,7 @@ class CZapitChannel
|
||||
void setEPGid(t_channel_id pEPGid) { epg_id = pEPGid; } //remap epg_id
|
||||
std::string getAlternateLogo(void) const { return altlogo; }
|
||||
inline void setAlternateLogo(const std::string &pLogo) { altlogo = pLogo; }
|
||||
void setThrAlternateLogo(const std::string &pLogo);
|
||||
};
|
||||
|
||||
struct CmpChannelBySat: public std::binary_function <const CZapitChannel * const, const CZapitChannel * const, bool>
|
||||
|
@@ -1037,7 +1037,7 @@ void CBouquetManager::loadWebchannels(int mode)
|
||||
CZapitChannel * channel = new CZapitChannel(title.c_str(), chid, url, desc.c_str(), chid, epg_script.c_str(), mode);
|
||||
CServiceManager::getInstance()->AddChannel(channel);
|
||||
if (!alogo.empty())
|
||||
channel->setAlternateLogo(dlTmpName(alogo));
|
||||
channel->setThrAlternateLogo(alogo);
|
||||
channel->flags = CZapitChannel::UPDATED;
|
||||
if (gbouquet)
|
||||
gbouquet->addService(channel);
|
||||
|
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
#include <system/helpers.h>
|
||||
#include <zapit/zapit.h>
|
||||
#include <zapit/channel.h>
|
||||
|
||||
@@ -109,6 +110,7 @@ void CZapitChannel::Init()
|
||||
bLockCount = 0;
|
||||
bLocked = DEFAULT_CH_LOCKED;
|
||||
bUseCI = false;
|
||||
thrLogo = NULL;
|
||||
altlogo = "";
|
||||
}
|
||||
|
||||
@@ -420,3 +422,31 @@ void CZapitChannel::dumpBouquetXml(FILE * fd, bool bUser)
|
||||
|
||||
fprintf(fd, "/>\n");
|
||||
}
|
||||
|
||||
void CZapitChannel::setThrAlternateLogo(const std::string &pLogo)
|
||||
{
|
||||
//printf("CZapitChannel::setAlternateLogo: [%s]\n", pLogo.c_str());
|
||||
|
||||
altlogo = pLogo;
|
||||
|
||||
if(thrLogo != 0)
|
||||
{
|
||||
pthread_cancel(thrLogo);
|
||||
pthread_join(thrLogo, NULL);
|
||||
thrLogo = 0;
|
||||
}
|
||||
|
||||
pthread_create(&thrLogo, NULL, LogoThread, (void *)this);
|
||||
}
|
||||
|
||||
void* CZapitChannel::LogoThread(void* channel)
|
||||
{
|
||||
CZapitChannel *cc = (CZapitChannel *)channel;
|
||||
std::string lname = cc->getAlternateLogo();
|
||||
cc->setAlternateLogo(dlTmpName(lname));
|
||||
|
||||
pthread_exit(0);
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user