renderer: move waveform generation into worker and mutex the waveform

Addresses scheduling issues where a backend might be closed (or even
destroyed) before it processes a waveform signal from a worker. Requires
extra multithreading code.
This commit is contained in:
itsmattkc
2020-06-05 15:18:14 +10:00
parent ddf63b39e1
commit de3288893d
7 changed files with 59 additions and 51 deletions
+3 -5
View File
@@ -50,9 +50,9 @@ public:
update_with_graph_ = e;
}
void SetGeneratePreviews(bool e)
void EnablePreviewGeneration(qint64 job_time)
{
generate_previews_ = e;
preview_job_time_ = job_time;
}
void ClearVideoQueue();
@@ -121,13 +121,11 @@ private:
bool update_with_graph_;
bool generate_previews_;
qint64 preview_job_time_;
private slots:
void WorkerFinished();
void WorkerGeneratedWaveform(const OLIVE_NAMESPACE::TrackOutput* copied_track, const OLIVE_NAMESPACE::AudioVisualWaveform& samples, const OLIVE_NAMESPACE::rational& start);
};
OLIVE_NAMESPACE_EXIT