Fix -1 since last update error in Buffer
This commit is contained in:
parent
6f035f3bc6
commit
dd5ae98002
1 changed files with 7 additions and 4 deletions
|
@ -432,20 +432,23 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
for (std::set<size_t>::iterator idx = tracks.begin(); idx != tracks.end(); idx++){
|
for (std::set<size_t>::iterator idx = tracks.begin(); idx != tracks.end(); idx++){
|
||||||
size_t i = *idx;
|
size_t i = *idx;
|
||||||
|
uint64_t lastUp = M.getLastUpdated(i);
|
||||||
|
//Prevent issues when getLastUpdated > current time. This can happen if the second rolls over exactly during this loop.
|
||||||
|
if (lastUp >= time){continue;}
|
||||||
std::string codec = M.getCodec(i);
|
std::string codec = M.getCodec(i);
|
||||||
std::string type = M.getType(i);
|
std::string type = M.getType(i);
|
||||||
uint64_t firstms = M.getFirstms(i);
|
uint64_t firstms = M.getFirstms(i);
|
||||||
uint64_t lastms = M.getLastms(i);
|
uint64_t lastms = M.getLastms(i);
|
||||||
// if not updated for an entire buffer duration, or last updated track and this track differ
|
// if not updated for an entire buffer duration, or last updated track and this track differ
|
||||||
// by an entire buffer duration, erase the track.
|
// by an entire buffer duration, erase the track.
|
||||||
if ((time - M.getLastUpdated(i) > (bufferTime / 1000) ||
|
if ((time - lastUp > (bufferTime / 1000) ||
|
||||||
(compareLast && activeTypes.count(type) && (time - M.getLastUpdated(i)) > 5 &&
|
(compareLast && activeTypes.count(type) && (time - lastUp) > 5 &&
|
||||||
((compareLast < firstms && (firstms - compareLast) > bufferTime) ||
|
((compareLast < firstms && (firstms - compareLast) > bufferTime) ||
|
||||||
(compareFirst > lastms && (compareFirst - lastms) > bufferTime))))){
|
(compareFirst > lastms && (compareFirst - lastms) > bufferTime))))){
|
||||||
// erase this track
|
// erase this track
|
||||||
if ((time - M.getLastUpdated(i)) > (bufferTime / 1000)){
|
if ((time - lastUp) > (bufferTime / 1000)){
|
||||||
WARN_MSG("Erasing %s track %zu (%s/%s) because not updated for %" PRIu64 "s (> %" PRIu64 "s)",
|
WARN_MSG("Erasing %s track %zu (%s/%s) because not updated for %" PRIu64 "s (> %" PRIu64 "s)",
|
||||||
streamName.c_str(), i, type.c_str(), codec.c_str(), time - M.getLastUpdated(i),
|
streamName.c_str(), i, type.c_str(), codec.c_str(), time - lastUp,
|
||||||
bufferTime / 1000);
|
bufferTime / 1000);
|
||||||
}else{
|
}else{
|
||||||
WARN_MSG("Erasing %s inactive track %zu (%s/%s) because it was inactive for 5+ seconds "
|
WARN_MSG("Erasing %s inactive track %zu (%s/%s) because it was inactive for 5+ seconds "
|
||||||
|
|
Loading…
Add table
Reference in a new issue