diff --git a/rendering/audio.cpp b/rendering/audio.cpp index 183479683..fb7083bf6 100644 --- a/rendering/audio.cpp +++ b/rendering/audio.cpp @@ -424,8 +424,9 @@ void SetAudioWakeObject(QObject *o) audio_wake_mutex.unlock(); } -void WakeAudioWakeObject() { +void WakeAudioWakeObject() { QObject* audio_wake_object = GetAudioWakeObject(); + if (audio_wake_object != nullptr) { QMetaObject::invokeMethod(audio_wake_object, "play_wake", Qt::QueuedConnection); } diff --git a/rendering/cacher.cpp b/rendering/cacher.cpp index a4df18c65..4621b2d03 100644 --- a/rendering/cacher.cpp +++ b/rendering/cacher.cpp @@ -1194,6 +1194,7 @@ void Cacher::Open() void Cacher::Cache(long playhead, bool scrubbing, QVector& nests, int playback_speed) { + if (!is_valid_state_) { return; } diff --git a/rendering/exportthread.cpp b/rendering/exportthread.cpp index 5cb1afe5c..5a878b004 100644 --- a/rendering/exportthread.cpp +++ b/rendering/exportthread.cpp @@ -487,7 +487,7 @@ void ExportThread::Export() // If we're exporting audio, copy audio from the buffer into an AVFrame for encoding if (params_.audio_enabled) { - if (waiting_for_audio_) { + if (waiting_for_audio_ && !interrupt_) { waitCond.wait(&mutex); } @@ -685,7 +685,10 @@ bool ExportThread::WasInterrupted() void ExportThread::Interrupt() { + mutex.lock(); interrupt_ = true; + waitCond.wakeAll(); + mutex.unlock(); } void ExportThread::play_wake() diff --git a/rendering/renderfunctions.cpp b/rendering/renderfunctions.cpp index c4c45fcd2..3032ccd10 100644 --- a/rendering/renderfunctions.cpp +++ b/rendering/renderfunctions.cpp @@ -278,6 +278,7 @@ GLuint olive::rendering::compose_sequence(ComposeSequenceParams ¶ms) { } if (params.video) { + // set default coordinates based on the sequence, with 0 in the direct center glPushMatrix(); glLoadIdentity(); @@ -287,6 +288,7 @@ GLuint olive::rendering::compose_sequence(ComposeSequenceParams ¶ms) { int half_width = s->width/2; int half_height = s->height/2; glOrtho(-half_width, half_width, -half_height, half_height, -1, 10); + } // loop through current clips @@ -609,7 +611,17 @@ GLuint olive::rendering::compose_sequence(ComposeSequenceParams ¶ms) { params.nests.removeLast(); } else { // Check whether cacher is currently active, if not activate it now - if (c->cache_lock.tryLock()) { + + bool got_mutex2 = false; + + if (params.wait_for_mutexes) { + c->cache_lock.lock(); + got_mutex2 = true; + } else { + got_mutex2 = c->cache_lock.tryLock(got_mutex2); + } + + if (got_mutex2) { c->cache_lock.unlock();