Allow to abort making Mkv file when calculating cues

This commit is contained in:
Martchus 2017-10-09 21:00:52 +02:00
parent b1f207303c
commit 17c76a5f29
1 changed files with 10 additions and 1 deletions

View File

@ -1210,8 +1210,12 @@ nonRewriteCalculations:
if(segment.cuesElement && segment.cuesUpdater.updateOffsets(clusterReadOffset, level1Element->startOffset() - 4 - segment.sizeDenotationLength - ebmlHeaderSize) && newCuesPos == ElementPosition::BeforeData) {
cuesInvalidated = true;
}
// check whether aborted (because this loop might take some seconds to process)
if(isAborted()) {
throw OperationAbortedException();
}
// update the progress percentage (using offset / file size should be accurate enough)
if((index % 50 == 0) && fileInfo().size()) {
if(index % 50 == 0) {
updatePercentage(static_cast<double>(level1Element->dataOffset()) / fileInfo().size());
}
}
@ -1353,10 +1357,15 @@ nonRewriteCalculations:
}
}
// check whether aborted (because this loop might take some seconds to process)
if(isAborted()) {
throw OperationAbortedException();
}
// update the progress percentage (using offset / file size should be accurate enough)
if((index % 50 == 0) && fileInfo().size()) {
updatePercentage(static_cast<double>(level1Element->dataOffset()) / fileInfo().size());
}
// TODO: reduce code duplication for aborting and progress updates
}
// check whether the total size of the "Cues"-element has been invalidated and recompute cluster if required
if(cuesInvalidated) {