UI: fix getting stuck after vipc recv timeout

old-commit-hash: 86beb9a81a
This commit is contained in:
Adeeb Shihadeh
2021-09-15 20:31:06 -07:00
parent ed25cf30f4
commit b3a1f2c67d
+6 -4
View File
@@ -252,17 +252,19 @@ void CameraViewWidget::updateFrame() {
resizeGL(width(), height());
}
VisionBuf *buf = nullptr;
if (vipc_client->connected) {
VisionBuf *buf = vipc_client->recv();
buf = vipc_client->recv();
if (buf != nullptr) {
latest_frame = buf;
update();
emit frameUpdated();
} else if (!Hardware::PC()) {
} else {
LOGE("visionIPC receive timeout");
}
} else {
// try to connect again quickly
}
if (buf == nullptr) {
// try to connect or recv again
QTimer::singleShot(1000. / UI_FREQ, this, &CameraViewWidget::updateFrame);
}
}