encoder: write audio in segments

I'll be honest, this probably makes no noticeable difference at all. It should be faster and more efficient, but whether that translates into any tangible improvement is yet to be seen.
This commit is contained in:
itsmattkc
2021-05-10 00:44:08 +10:00
parent 27653f10dc
commit 15556c64ae
12 changed files with 295 additions and 152 deletions
+13 -6
View File
@@ -57,17 +57,24 @@ bool RenderTask::Render(ColorManager* manager,
qint64 job_time = QDateTime::currentMSecsSinceEpoch();
// Queue audio jobs
foreach (const TimeRange& r, audio_range) {
foreach (const TimeRange& range, audio_range) {
// Don't count audio progress, since it's generally a lot faster than video and is weighted at
// 50%, which makes the progress bar look weird to the uninitiated
//total_length += r.length().toDouble();
IncrementRunningTickets();
rational r = range.in();
while (r != range.out()) {
rational end = qMin(range.out(), r+1);
TimeRange this_range(r, end);
RenderTicketWatcher* watcher = new RenderTicketWatcher();
watcher->setProperty("range", QVariant::fromValue(r));
PrepareWatcher(watcher, &watcher_thread);
watcher->SetTicket(RenderManager::instance()->RenderAudio(viewer_, r, audio_params_, false));
RenderTicketWatcher* watcher = new RenderTicketWatcher();
watcher->setProperty("range", QVariant::fromValue(this_range));
PrepareWatcher(watcher, &watcher_thread);
IncrementRunningTickets();
watcher->SetTicket(RenderManager::instance()->RenderAudio(viewer_, this_range, audio_params_, false));
r = end;
}
}
// Look up hashes