mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
driver/record.cpp: save added pids from pmt update;
add safe-check for max pids recorded
This commit is contained in:
@@ -175,8 +175,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||
psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str());
|
||||
}else
|
||||
psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str());
|
||||
|
||||
if (numpids >= REC_MAX_APIDS)
|
||||
break;
|
||||
}
|
||||
if ((StreamVTxtPid) && (allpids.PIDs.vtxtpid != 0)){
|
||||
if ((StreamVTxtPid) && (allpids.PIDs.vtxtpid != 0) && (numpids < REC_MAX_APIDS)){
|
||||
apids[numpids++] = allpids.PIDs.vtxtpid;
|
||||
psi.addPid(allpids.PIDs.vtxtpid, EN_TYPE_TELTEX, 0, channel->getTeletextLang());
|
||||
}
|
||||
@@ -186,6 +189,8 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||
if (s->thisSubType == CZapitAbsSub::DVB) {
|
||||
if(i>9)//max sub pids
|
||||
break;
|
||||
if (numpids >= REC_MAX_APIDS)
|
||||
break;
|
||||
|
||||
CZapitDVBSub* sd = reinterpret_cast<CZapitDVBSub*>(s);
|
||||
apids[numpids++] = sd->pId;
|
||||
@@ -196,9 +201,10 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
|
||||
}
|
||||
psi.genpsi(fd);
|
||||
|
||||
|
||||
if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0))
|
||||
#if 0
|
||||
if ((StreamPmtPid) && (allpids.PIDs.pmtpid != 0) && (numpids < REC_MAX_APIDS))
|
||||
apids[numpids++] = allpids.PIDs.pmtpid;
|
||||
#endif
|
||||
|
||||
if(record == NULL)
|
||||
record = new cRecord(channel->getRecordDemux() /*RECORD_DEMUX*/);
|
||||
@@ -317,6 +323,9 @@ bool CRecordInstance::Update()
|
||||
if(!found) {
|
||||
update = true;
|
||||
printf("%s: apid %x not found in recording pids\n", __FUNCTION__, it->apid);
|
||||
if (numpids < REC_MAX_APIDS)
|
||||
apids[numpids++] = it->apid;
|
||||
|
||||
record->AddPid(it->apid);
|
||||
for(unsigned int i = 0; i < allpids.APIDs.size(); i++) {
|
||||
if(allpids.APIDs[i].pid == it->apid) {
|
||||
|
Reference in New Issue
Block a user