mirror of https://github.com/odrling/Aegisub
Remove progress throttling from ffms indexing
This commit is contained in:
parent
d9df9c9e5b
commit
c30ca1a321
|
@ -96,19 +96,13 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, agi::fs::pat
|
||||||
br->Run([&](agi::ProgressSink *ps) {
|
br->Run([&](agi::ProgressSink *ps) {
|
||||||
ps->SetTitle(from_wx(_("Indexing")));
|
ps->SetTitle(from_wx(_("Indexing")));
|
||||||
ps->SetMessage(from_wx(_("Reading timecodes and frame/sample data")));
|
ps->SetMessage(from_wx(_("Reading timecodes and frame/sample data")));
|
||||||
struct progress {
|
|
||||||
agi::ProgressSink *ps;
|
|
||||||
int calls;
|
|
||||||
};
|
|
||||||
progress state = { ps, 0 };
|
|
||||||
TIndexCallback callback = [](int64_t Current, int64_t Total, void *Private) -> int {
|
TIndexCallback callback = [](int64_t Current, int64_t Total, void *Private) -> int {
|
||||||
auto state = static_cast<progress *>(Private);
|
auto ps = static_cast<agi::ProgressSink *>(Private);
|
||||||
if (++state->calls % 10 == 0)
|
ps->SetProgress(Current, Total);
|
||||||
state->ps->SetProgress(Current, Total);
|
return ps->IsCancelled();
|
||||||
return state->ps->IsCancelled();
|
|
||||||
};
|
};
|
||||||
Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE,
|
Index = FFMS_DoIndexing(Indexer, Trackmask, FFMS_TRACKMASK_NONE,
|
||||||
nullptr, nullptr, IndexEH, callback, &state, &ErrInfo);
|
nullptr, nullptr, IndexEH, callback, ps, &ErrInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Index == nullptr) {
|
if (Index == nullptr) {
|
||||||
|
|
Loading…
Reference in New Issue