Replay: fix crashing from trimSegment

old-commit-hash: aeafb8e00c
This commit is contained in:
iejMac 2021-04-27 23:32:42 -07:00
parent 13dbb65b98
commit 86a1616de9
2 changed files with 0 additions and 16 deletions

View File

@ -47,18 +47,6 @@ void Replay::addSegment(int i){
frs.insert(i, new FrameReader(qPrintable(camera_fn)));
}
void Replay::trimSegment(int n){
event_sizes.enqueue(events.size() - event_sizes.last());
auto first = events.begin();
for(int i = 0 ; i < n ; i++){
int remove = event_sizes.dequeue();
for(int j = 0 ; j < remove ; j++){
first = events.erase(first);
}
}
}
void Replay::stream(SubMaster *sm){
QThread* thread = new QThread;
unlogger->moveToThread(thread);
@ -69,8 +57,5 @@ void Replay::stream(SubMaster *sm){
QObject::connect(unlogger, &Unlogger::loadSegment, [=](){
addSegment(++current_segment);
if (current_segment > 1) {
trimSegment(1);
}
});
}

View File

@ -23,7 +23,6 @@ public:
Replay(QString route_, int seek);
void stream(SubMaster *sm = nullptr);
void addSegment(int i);
void trimSegment(int n);
QJsonArray camera_paths;
QJsonArray log_paths;