scansdt: check dmx

This commit is contained in:
Jacek Jendrzej
2018-09-25 20:25:30 +02:00
parent 06808405b5
commit f5bc433d7e

View File

@@ -69,6 +69,8 @@ bool CSdt::PMTPing(unsigned short pid, unsigned short sid)
unsigned char buffer[PMT_SECTION_SIZE];
cDemux * dmx = new cDemux(dmxnum);
bool badservice = false;
if(dmx){
dmx->Open(DMX_PSI_CHANNEL);
memset(filter, 0x00, DMX_FILTER_SIZE);
@@ -91,15 +93,17 @@ bool CSdt::PMTPing(unsigned short pid, unsigned short sid)
ProgramMapSection pmt(buffer);
if(0x1fff==pmt.getPcrPid()){
ret = false;
badservice = false;
}else{
ret = true;
}
}
}
delete dmx;
}
#ifdef DEBUG_SDT
if(!ret)
printf("Ping: PMT-pid 0%x failed\n", pid);
printf("Ping: PMT-pid 0%x %s\n", pid,badservice ? "not supportet stream type":"failed");
#endif
return ret;
}