Fixed DTSC input bug with ping commands

This commit is contained in:
Thulinma 2017-01-06 19:18:03 +01:00
parent ba2ef09a7e
commit 8f38872ffc

View file

@ -233,6 +233,7 @@ namespace Mist {
void inputDTSC::getNext(bool smart) {
if (!needsLock()){
thisPacket.reInit(srcConn);
while (config->is_active){
if (thisPacket.getVersion() == DTSC::DTCM){
nProxy.userClient.keepAlive();
std::string cmd;
@ -269,16 +270,14 @@ namespace Mist {
INFO_MSG("Reset: deleting track %d", *it);
myMeta.tracks.erase(*it);
}
//Read next packet before returning
return getNext(smart);
thisPacket.reInit(srcConn);//read the next packet before continuing
}else{
myMeta = DTSC::Meta();
}
}else{
//Read next packet before returning
thisPacket.reInit(srcConn);
thisPacket.reInit(srcConn);//read the next packet before continuing
}
continue;//parse the next packet before returning
}else if (thisPacket.getVersion() == DTSC::DTSC_HEAD){
DTSC::Meta newMeta;
newMeta.reinit(thisPacket);
@ -294,7 +293,19 @@ namespace Mist {
myMeta.tracks[*it] = newMeta.tracks[*it];
continueNegotiate(*it, true);
}
return getNext(smart);
thisPacket.reInit(srcConn);//read the next packet before continuing
continue;//parse the next packet before returning
}
//We now know we have either a data packet, or an error.
if (!thisPacket.getTrackId()){
if (thisPacket.getVersion() == DTSC::DTSC_V2){
WARN_MSG("Received bad packet for stream %s: %llu@%llu", streamName.c_str(), thisPacket.getTrackId(), thisPacket.getTime());
}else{
//All types except data packets are handled above, so if it's not a V2 data packet, we assume corruption
WARN_MSG("Invalid packet header for stream %s", streamName.c_str());
}
}
return;//we have a packet
}
}else{
if (smart) {