viewer: fixed bugs in playback queue

Fixed issue that caused playback queue to desync and fallback to much slower
live playback.
This commit is contained in:
itsmattkc
2020-05-20 12:52:47 +10:00
parent 470bb44d0a
commit 0dc548a97e
3 changed files with 54 additions and 44 deletions
+4 -11
View File
@@ -38,20 +38,13 @@ public:
void AppendTimewise(const ViewerPlaybackFrame& f, int playback_speed)
{
reverse_iterator i = this->rbegin();
if (this->isEmpty() || (this->last().timestamp < f.timestamp) == (playback_speed > 0)) {
this->append(f);
} else {
while (i != this->rend()) {
reverse_iterator next = i + 1;
if ((next->timestamp < f.timestamp) == (playback_speed > 0)) {
this->insert(i.base(), f);
return;
} else {
i = next;
for (iterator i=this->begin(); i!=this->end(); i++) {
if ((i->timestamp > f.timestamp) == (playback_speed > 0)) {
this->insert(i, f);
break;
}
}
}