oiiodecoder: check for sequential images in sequence heuristic
This commit is contained in:
@@ -62,17 +62,23 @@ bool OIIODecoder::Probe(Footage *f, const QAtomicInt *cancelled)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_sequence_ = false;
|
||||||
|
|
||||||
// Heuristically determine whether this file is part of an image sequence or not
|
// Heuristically determine whether this file is part of an image sequence or not
|
||||||
if (GetImageSequenceDigitCount(f->filename()) > 0) {
|
if (GetImageSequenceDigitCount(f->filename()) > 0) {
|
||||||
// We need user feedback here and since UI must occur in the UI thread (and we could be in any thread), we defer
|
int64_t ind = GetImageSequenceIndex(f->filename());
|
||||||
// to the Core which will definitely be in the UI thread and block here until we get an answer from the user
|
|
||||||
QMetaObject::invokeMethod(Core::instance(),
|
// Check if files around exist around it with that follow a sequence
|
||||||
"ConfirmImageSequence",
|
if (QFileInfo::exists(TransformImageSequenceFileName(f->filename(), ind - 1))
|
||||||
Qt::BlockingQueuedConnection,
|
|| QFileInfo::exists(TransformImageSequenceFileName(f->filename(), ind + 1))) {
|
||||||
Q_RETURN_ARG(bool, is_sequence_),
|
// We need user feedback here and since UI must occur in the UI thread (and we could be in any thread), we defer
|
||||||
Q_ARG(QString, f->filename()));
|
// to the Core which will definitely be in the UI thread and block here until we get an answer from the user
|
||||||
} else {
|
QMetaObject::invokeMethod(Core::instance(),
|
||||||
is_sequence_ = false;
|
"ConfirmImageSequence",
|
||||||
|
Qt::BlockingQueuedConnection,
|
||||||
|
Q_RETURN_ARG(bool, is_sequence_),
|
||||||
|
Q_ARG(QString, f->filename()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageStreamPtr image_stream;
|
ImageStreamPtr image_stream;
|
||||||
|
|||||||
Reference in New Issue
Block a user