Always call QFutureWatcher::setFuture after connects

This commit is contained in:
Jonas Kvinge
2021-06-16 00:30:21 +02:00
parent d2d3f58a14
commit 8699790e78
15 changed files with 27 additions and 27 deletions

View File

@@ -237,12 +237,12 @@ bool GstEngine::Play(const quint64 offset_nanosec) {
QFuture<GstStateChangeReturn> future = current_pipeline_->SetState(GST_STATE_PLAYING);
QFutureWatcher<GstStateChangeReturn> *watcher = new QFutureWatcher<GstStateChangeReturn>();
watcher->setFuture(future);
int pipeline_id = current_pipeline_->id();
QObject::connect(watcher, &QFutureWatcher<GstStateChangeReturn>::finished, this, [this, watcher, offset_nanosec, pipeline_id]() {
PlayDone(watcher->result(), offset_nanosec, pipeline_id);
watcher->deleteLater();
});
watcher->setFuture(future);
if (is_fading_out_to_pause_) {
current_pipeline_->SetState(GST_STATE_PAUSED);