// to use this old code you should read my comment in addCADescriptor..
if ( eDVB::getInstance()->recorder && eServiceInterface::getInstance()->service.path )
return;
eDebug("-------------------Set ECM-----------------");
static int lastpid=-1;
if (lastpid != -1)
{
kill(lastpid, SIGKILL);
waitpid(lastpid, 0, 0);
lastpid=-1;
}
if (!descriptor_length)
return;
char buffer[3][5];
sprintf(buffer[0], "%x", vpid);
sprintf(buffer[1], "%x", apid);
eDVBServiceController *sapi=eDVB::getInstance()->getServiceAPI();
if (!sapi)
return;
sprintf(buffer[2], "%x", sapi->service.getServiceID().get());
char descriptor[2048];
for (int i=0; i<descriptor_length; i++)
sprintf(descriptor+i*2, "%02x", descriptors[i]);
switch (lastpid=fork())
{
case -1:
eDebug("fork failed!");
return;
case 0:
{
close(0);
close(1);
close(2);
for (unsigned int i=0; i < 90; ++i )
close(i);
if (execlp("/var/bin/rdgd", "/var/bin/rdgd", buffer[0], buffer[1], buffer[2], descriptor, 0)<0)
eDebug("rdgd");
_exit(0);
break;
}
}
}
Záložky