Fixed TS stream parser not parsing last PES packet sometimes
This commit is contained in:
parent
0c8261bf2f
commit
6f6827607d
1 changed files with 7 additions and 1 deletions
|
@ -366,7 +366,7 @@ namespace TS{
|
||||||
psCache = &(pesStreams[tid]);
|
psCache = &(pesStreams[tid]);
|
||||||
psCacheTid = tid;
|
psCacheTid = tid;
|
||||||
}
|
}
|
||||||
if (psCache->size() <= 1){
|
if (!psCache->size() || (!finished && psCache->size() <= 1)){
|
||||||
if (!finished){FAIL_MSG("No PES packets to parse");}
|
if (!finished){FAIL_MSG("No PES packets to parse");}
|
||||||
seenUnitStart[tid] = 0;
|
seenUnitStart[tid] = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -535,6 +535,12 @@ namespace TS{
|
||||||
// headers/padding
|
// headers/padding
|
||||||
offset += realPayloadSize + (9 + pesHeader[8]);
|
offset += realPayloadSize + (9 + pesHeader[8]);
|
||||||
}
|
}
|
||||||
|
if (finished && (pidToCodec[tid] == H264 || pidToCodec[tid] == H265)){
|
||||||
|
if (buildPacket.count(tid) && buildPacket[tid].getDataStringLen()){
|
||||||
|
outPackets[tid].push_back(buildPacket[tid]);
|
||||||
|
buildPacket.erase(tid);
|
||||||
|
}
|
||||||
|
}
|
||||||
free(payload);
|
free(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue