Fixed JIT timestamps for live

This commit is contained in:
Thulinma 2016-11-14 10:55:58 +01:00
parent 19b67e4551
commit 94e39f8323

View file

@ -917,17 +917,27 @@ namespace Mist {
//if there's a timestamp mismatch, print this.
//except for live, where we never know the time in advance
if (thisPacket.getTime() != nxt.time && nxt.time && !atLivePoint){
if (thisPacket.getTime() != nxt.time && nxt.time){
if (!atLivePoint){
static int warned = 0;
if (warned < 5){
WARN_MSG("Loaded %s track %ld@%llu instead of %u@%llu (%dms, %s, offset %lu)", streamName.c_str(), thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, (int)((long long)thisPacket.getTime() - (long long)nxt.time), myMeta.tracks[nxt.tid].codec.c_str(), nxt.offset);
if (++warned == 5){
WARN_MSG("Further warnings about time mismatches printed on HIGH level.");
}
WARN_MSG("Loaded %s track %ld@%llu instead of %u@%llu (%dms, %s, offset %lu)", streamName.c_str(), thisPacket.getTrackId(),
thisPacket.getTime(), nxt.tid, nxt.time, (int)((long long)thisPacket.getTime() - (long long)nxt.time),
myMeta.tracks[nxt.tid].codec.c_str(), nxt.offset);
if (++warned == 5){WARN_MSG("Further warnings about time mismatches printed on HIGH level.");}
}else{
HIGH_MSG("Loaded %s track %ld@%llu instead of %u@%llu (%dms, %s, offset %lu)", streamName.c_str(), thisPacket.getTrackId(), thisPacket.getTime(), nxt.tid, nxt.time, (int)((long long)thisPacket.getTime() - (long long)nxt.time), myMeta.tracks[nxt.tid].codec.c_str(), nxt.offset);
HIGH_MSG("Loaded %s track %ld@%llu instead of %u@%llu (%dms, %s, offset %lu)", streamName.c_str(), thisPacket.getTrackId(),
thisPacket.getTime(), nxt.tid, nxt.time, (int)((long long)thisPacket.getTime() - (long long)nxt.time),
myMeta.tracks[nxt.tid].codec.c_str(), nxt.offset);
}
}
nxt.time = thisPacket.getTime();
//swap out the next object in the buffer with a new one
buffer.erase(buffer.begin());
buffer.insert(nxt);
VERYHIGH_MSG("JIT reordering %u@%llu.", nxt.tid, nxt.time);
return false;
}
//when live, every keyframe, check correctness of the keyframe number
if (myMeta.live && thisPacket.getFlag("keyframe")){