Fixed TS live input

This commit is contained in:
Thulinma 2017-05-12 17:04:03 +02:00
parent 401c323564
commit 492dcd03f5

View file

@ -229,11 +229,12 @@ namespace TS{
bool parsePes = false;
int packNum = 1;
// Usually we append a packet at a time, so the start code is expected to show up at the end.
std::deque<Packet> &inStream = pesStreams[tid];
if (!inStream.rbegin()->getUnitStart()){
if (threaded){globalSem.post();}
return;
}
if (inStream.rbegin()->getUnitStart()){
parsePes = true;
}else{
//But, sometimes (e.g. live) we do multiples, and need to check all of it...
std::deque<Packet>::iterator lastPack = inStream.end();
std::deque<Packet>::iterator curPack = inStream.begin();
curPack++;
@ -242,7 +243,7 @@ namespace TS{
packNum++;
}
if (curPack != lastPack){parsePes = true;}
}
if (threaded){globalSem.post();}
if (parsePes){parsePES(tid);}
@ -697,7 +698,7 @@ namespace TS{
if (threaded){globalSem.post();}
if (!packetReady){
ERROR_MSG("Obtaining a packet on track %lu failed", tid);
ERROR_MSG("Track %lu: PES without valid packets?", tid);
return;
}