continuity improvements
This commit is contained in:
parent
95f19c4259
commit
ff049f4ea2
2 changed files with 15 additions and 2 deletions
|
@ -205,6 +205,18 @@ namespace Mist {
|
||||||
|
|
||||||
H.SetHeader("Content-Type", "video/mp2t");
|
H.SetHeader("Content-Type", "video/mp2t");
|
||||||
H.StartResponse(H, myConn, VLCworkaround);
|
H.StartResponse(H, myConn, VLCworkaround);
|
||||||
|
|
||||||
|
unsigned int fragCounter = myMeta.tracks[vidTrack].missedFrags;
|
||||||
|
for (std::deque<DTSC::Fragment>::iterator it = myMeta.tracks[vidTrack].fragments.begin(); it != myMeta.tracks[vidTrack].fragments.end(); it++){
|
||||||
|
long long int starttime = myMeta.tracks[vidTrack].getKey(it->getNumber()).getTime();
|
||||||
|
if (starttime <= from && starttime + it->getDuration() > from){
|
||||||
|
EXTREME_MSG("setting continuity counter for PAT/PMT to %d",fragCounter);
|
||||||
|
contCounters[0]=fragCounter; //PAT continuity counter
|
||||||
|
contCounters[4096]=fragCounter; //PMT continuity counter
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++fragCounter;
|
||||||
|
}
|
||||||
packCounter = 0;
|
packCounter = 0;
|
||||||
parseData = true;
|
parseData = true;
|
||||||
wantRequest = false;
|
wantRequest = false;
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace Mist {
|
||||||
if ( (sendRepeatingHeaders && packCounter % 42 == 0) || !packCounter){
|
if ( (sendRepeatingHeaders && packCounter % 42 == 0) || !packCounter){
|
||||||
TS::Packet tmpPack;
|
TS::Packet tmpPack;
|
||||||
tmpPack.FromPointer(TS::PAT);
|
tmpPack.FromPointer(TS::PAT);
|
||||||
tmpPack.setContinuityCounter(++contCounters[tmpPack.getPID()]);
|
tmpPack.setContinuityCounter(++contCounters[0]);
|
||||||
sendTS(tmpPack.checkAndGetBuffer());
|
sendTS(tmpPack.checkAndGetBuffer());
|
||||||
sendTS(TS::createPMT(selectedTracks, myMeta, ++contCounters[tmpPack.getPID()]));
|
sendTS(TS::createPMT(selectedTracks, myMeta, ++contCounters[4096]));
|
||||||
packCounter += 2;
|
packCounter += 2;
|
||||||
}
|
}
|
||||||
sendTS(packData.checkAndGetBuffer());
|
sendTS(packData.checkAndGetBuffer());
|
||||||
|
@ -35,6 +35,7 @@ namespace Mist {
|
||||||
packData.setContinuityCounter(++contCounters[packData.getPID()]);
|
packData.setContinuityCounter(++contCounters[packData.getPID()]);
|
||||||
if (first[currentPacket.getTrackId()]){
|
if (first[currentPacket.getTrackId()]){
|
||||||
packData.setUnitStart(1);
|
packData.setUnitStart(1);
|
||||||
|
packData.setDiscontinuity(true);
|
||||||
if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){
|
if (myMeta.tracks[currentPacket.getTrackId()].type == "video"){
|
||||||
if (currentPacket.getInt("keyframe")){
|
if (currentPacket.getInt("keyframe")){
|
||||||
packData.setRandomAccess(1);
|
packData.setRandomAccess(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue