-added a termination slot to RecLoop that will kill the long term
 ffmpeg commands and connected it to 'aboutToQuit' signal. this is
 expected to kill the ffmpeg commands properly when quiting the
 main process.
This commit is contained in:
Zii 2023-06-01 16:59:37 -04:00
parent 4bf260c0ae
commit 16312a93f5
3 changed files with 17 additions and 7 deletions

View File

@ -116,6 +116,8 @@ void RecLoop::init()
recProc = new QProcess(this);
imgProc = new QProcess(this);
connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &RecLoop::term);
Loop::init();
}
@ -155,18 +157,22 @@ void RecLoop::updateCmd()
recLog("img_args_updated: " + imgArgs.join(" "), shared);
}
void RecLoop::term()
{
recProc->kill();
recProc->waitForFinished();
imgProc->kill();
imgProc->waitForFinished();
}
void RecLoop::reset()
{
recLog("--rec_and_img_cmds_resetting--", shared);
baseListRdy = false;
recProc->kill();
recProc->waitForFinished();
imgProc->kill();
imgProc->waitForFinished();
term();
updateCmd();
}

View File

@ -79,6 +79,10 @@ private slots:
void init();
public slots:
void term();
public:
explicit RecLoop(shared_t *shared, QThread *thr, QObject *parent = nullptr);

View File

@ -28,7 +28,7 @@
using namespace std;
#define APP_VER "3.0.t11"
#define APP_VER "3.0.t12"
#define APP_NAME "Motion Watch"
#define APP_BIN "mow"
#define REC_LOG_NAME "rec_log_lines.html"