TS PIDs and reserved bits are now set exactly like they were in 2.5.3 and earlier

This commit is contained in:
Thulinma 2016-06-29 09:46:26 +02:00
parent 0da945f8bb
commit 45ef9daac9
2 changed files with 5 additions and 5 deletions

View file

@ -745,7 +745,7 @@ namespace TS {
} }
void ProgramMappingEntry::setElementaryPid(int newElementaryPid) { void ProgramMappingEntry::setElementaryPid(int newElementaryPid) {
data[1] = newElementaryPid >> 8 & 0x1F; data[1] = (newElementaryPid >> 8 & 0x1F) | 0xE0; //0xE0 = three reserved bits
data[2] = newElementaryPid & 0xFF; data[2] = newElementaryPid & 0xFF;
} }
@ -758,7 +758,7 @@ namespace TS {
} }
void ProgramMappingEntry::setESInfo(const std::string & newInfo){ void ProgramMappingEntry::setESInfo(const std::string & newInfo){
data[3] = (newInfo.size() >> 8) & 0x0F; data[3] = ((newInfo.size() >> 8) & 0x0F) | 0xF0; //0xF0 = four reserved bits
data[4] = newInfo.size() & 0xFF; data[4] = newInfo.size() & 0xFF;
memcpy(data + 5, newInfo.data(), newInfo.size()); memcpy(data + 5, newInfo.data(), newInfo.size());
} }
@ -993,12 +993,12 @@ namespace TS {
if (vidTrack == -1){ if (vidTrack == -1){
vidTrack = *(selectedTracks.begin()); vidTrack = *(selectedTracks.begin());
} }
PMT.setPCRPID(256 + vidTrack); PMT.setPCRPID(255 + vidTrack);
PMT.setProgramInfoLength(0); PMT.setProgramInfoLength(0);
short id = 0; short id = 0;
ProgramMappingEntry entry = PMT.getEntry(0); ProgramMappingEntry entry = PMT.getEntry(0);
for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){ for (std::set<long unsigned int>::iterator it = selectedTracks.begin(); it != selectedTracks.end(); it++){
entry.setElementaryPid(256 + *it); entry.setElementaryPid(255 + *it);
entry.setESInfo(""); entry.setESInfo("");
if (myMeta.tracks[*it].codec == "H264"){ if (myMeta.tracks[*it].codec == "H264"){
entry.setStreamType(0x1B); entry.setStreamType(0x1B);

View file

@ -32,7 +32,7 @@ namespace Mist {
if (packData.getBytesFree() == 184){ if (packData.getBytesFree() == 184){
packData.clear(); packData.clear();
packData.setPID(256 + thisPacket.getTrackId()); packData.setPID(255 + thisPacket.getTrackId());
packData.setContinuityCounter(++contCounters[packData.getPID()]); packData.setContinuityCounter(++contCounters[packData.getPID()]);
if (first[thisPacket.getTrackId()]){ if (first[thisPacket.getTrackId()]){
packData.setUnitStart(1); packData.setUnitStart(1);