mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 22:23:56 +08:00
replay: add stop() function (#32673)
add stop() func
old-commit-hash: 3f84fe3557
This commit is contained in:
@@ -65,7 +65,9 @@ void ReplayStream::start() {
|
||||
}
|
||||
|
||||
void ReplayStream::stop() {
|
||||
replay.reset(nullptr);
|
||||
if (replay) {
|
||||
replay->stop();
|
||||
}
|
||||
}
|
||||
|
||||
bool ReplayStream::eventFilter(const Event *event) {
|
||||
|
||||
@@ -46,11 +46,15 @@ Replay::Replay(QString route, QStringList allow, QStringList block, SubMaster *s
|
||||
}
|
||||
|
||||
Replay::~Replay() {
|
||||
stop();
|
||||
}
|
||||
|
||||
void Replay::stop() {
|
||||
if (!stream_thread_ && segments_.empty()) return;
|
||||
|
||||
rInfo("shutdown: in progress...");
|
||||
if (stream_thread_ != nullptr) {
|
||||
exit_ =true;
|
||||
exit_ = true;
|
||||
paused_ = true;
|
||||
stream_cv_.notify_one();
|
||||
stream_thread_->quit();
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
~Replay();
|
||||
bool load();
|
||||
void start(int seconds = 0);
|
||||
void stop();
|
||||
void pause(bool pause);
|
||||
void seekToFlag(FindFlag flag);
|
||||
void seekTo(double seconds, bool relative);
|
||||
|
||||
Reference in New Issue
Block a user