try to index media immediately on import
Since indexing is supplemental, it can be made a background task that can occur at more or less any time. So we run it as soon as possible.
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "codec/ffmpeg/ffmpegdecoder.h"
|
||||
#include "codec/oiio/oiiodecoder.h"
|
||||
#include "task/index/index.h"
|
||||
#include "task/taskmanager.h"
|
||||
|
||||
Decoder::Decoder() :
|
||||
open_(false),
|
||||
@@ -126,6 +128,14 @@ bool Decoder::ProbeMedia(Footage *f)
|
||||
|
||||
// FIXME: Cache the results so we don't have to probe if this media is added a second time
|
||||
|
||||
// Start an index task
|
||||
foreach (StreamPtr stream, f->streams()) {
|
||||
qDebug() << "Starting index task on" << stream->footage()->filename() << stream->index();
|
||||
|
||||
IndexTask* index_task = new IndexTask(stream);
|
||||
TaskManager::instance()->AddTask(index_task);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -161,3 +171,7 @@ void Decoder::Conform(const AudioRenderingParams ¶ms)
|
||||
qCritical() << "Conform called on an audio decoder that does not have a handler for it:" << id();
|
||||
abort();
|
||||
}
|
||||
|
||||
void Decoder::Index()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user