mirror of
https://github.com/rofafor/vdr-plugin-satip.git
synced 2023-10-10 13:37:42 +02:00
Moved send loop one level down.
This commit is contained in:
parent
ece52576dd
commit
46a197d8f8
@ -271,29 +271,30 @@ cSatipSectionFilterHandler::~cSatipSectionFilterHandler()
|
|||||||
Delete(i);
|
Delete(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cSatipSectionFilterHandler::Send(void)
|
void cSatipSectionFilterHandler::SendAll(void)
|
||||||
{
|
{
|
||||||
// zero polling structures
|
while (true) {
|
||||||
memset(pollFdsM, 0, sizeof(pollFdsM));
|
// zero polling structures
|
||||||
|
memset(pollFdsM, 0, sizeof(pollFdsM));
|
||||||
|
|
||||||
// assemble all handlers to poll
|
// assemble all handlers to poll
|
||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (filtersM[i] && filtersM[i]->Available() != 0) {
|
if (filtersM[i] && filtersM[i]->Available() != 0) {
|
||||||
pollFdsM[i].fd = filtersM[i]->GetFd();
|
pollFdsM[i].fd = filtersM[i]->GetFd();
|
||||||
pollFdsM[i].events = POLLOUT;
|
pollFdsM[i].events = POLLOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anyone ready for writing
|
// anyone ready for writing
|
||||||
if (poll(pollFdsM, eMaxSecFilterCount, eSecFilterSendTimeoutMs) <= 0)
|
if (poll(pollFdsM, eMaxSecFilterCount, eSecFilterSendTimeoutMs) <= 0)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
// send data
|
// send data
|
||||||
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
for (unsigned int i = 0; i < eMaxSecFilterCount; ++i) {
|
||||||
if (pollFdsM[i].revents & POLLOUT)
|
if (pollFdsM[i].revents & POLLOUT)
|
||||||
filtersM[i]->Send();
|
filtersM[i]->Send();
|
||||||
}
|
}
|
||||||
return true;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSatipSectionFilterHandler::Action(void)
|
void cSatipSectionFilterHandler::Action(void)
|
||||||
@ -330,7 +331,7 @@ void cSatipSectionFilterHandler::Action(void)
|
|||||||
|
|
||||||
// Send demuxed section packets through all filters
|
// Send demuxed section packets through all filters
|
||||||
mutexM.Lock();
|
mutexM.Lock();
|
||||||
while (Send()) ;
|
SendAll();
|
||||||
mutexM.Unlock();
|
mutexM.Unlock();
|
||||||
}
|
}
|
||||||
debug1("%s Exiting [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
|
debug1("%s Exiting [device %d]", __PRETTY_FUNCTION__, deviceIndexM);
|
||||||
|
@ -76,7 +76,7 @@ private:
|
|||||||
|
|
||||||
bool Delete(unsigned int indexP);
|
bool Delete(unsigned int indexP);
|
||||||
bool IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const;
|
bool IsBlackListed(u_short pidP, u_char tidP, u_char maskP) const;
|
||||||
bool Send(void);
|
void SendAll(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void Action(void);
|
virtual void Action(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user