Updates for buffer stream resetting.

This commit is contained in:
Erik Zandvliet 2013-07-22 11:36:19 +02:00
parent a906da6caf
commit 6666cf22f0

View file

@ -195,7 +195,15 @@ void DTSC::Stream::addPacket(JSON::Value & newPack){
if (buffers.size() > 0){ if (buffers.size() > 0){
livePos lastPos = buffers.rbegin()->first; livePos lastPos = buffers.rbegin()->first;
if (newPos < lastPos){ if (newPos < lastPos){
newPos.seekTime = lastPos.seekTime+1; if (newPos.seekTime < lastPos.seekTime - 1000){
metadata.null();
metadata["reset"] = 1LL;
buffers.clear;
keyframes.clear();
trackMapping.clear();
}else{
newPos.seekTime = lastPos.seekTime+1;
}
} }
} }
std::string newTrack = trackMapping[newPos.trackID]; std::string newTrack = trackMapping[newPos.trackID];