From 911d13164c828120c90bddf87baa9fa80d1acd19 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 14 Oct 2020 17:05:15 +1100 Subject: [PATCH] render task: queue all hashes and audio tasks in advance --- app/task/render/render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/task/render/render.cpp b/app/task/render/render.cpp index abeff4120..bd813ac19 100644 --- a/app/task/render/render.cpp +++ b/app/task/render/render.cpp @@ -122,7 +122,7 @@ void RenderTask::Render(const TimeRangeList& video_range, || !download_futures.empty() || !audio_lookup_table.empty())) { - if (!IsCancelled() && !frame_queue.empty()) { + while (!IsCancelled() && !frame_queue.empty()) { // Pop another frame off the frame queue const HashTimePair& p = frame_queue.front(); @@ -168,7 +168,7 @@ void RenderTask::Render(const TimeRangeList& video_range, frame_queue.pop_front(); } - if (!IsCancelled() && !audio_queue.empty()) { + while (!IsCancelled() && !audio_queue.empty()) { audio_lookup_table.push_back({audio_queue.front(), backend_->RenderAudio(audio_queue.front())}); audio_queue.pop_front(); }